src/php/main/Eix/Services/Data/Responders/CollectionManager.php
protected function storeEntity()
    {
        $request = $this->getRequest();
        $id = $request->getParameter('id');
        // Try to find an existing instance of the entity.
        $entity = NULL;
        try {
            $entity = $this->getFactory()->findEntity($id);
        } catch (NotFoundException $exception) {
            // Not found? Create it.
            $className = $this->getFactory()->getEntitiesClassName();
            $entity = new $className(array(
                'id' => $id,
            ));
        }


        // Get the data from the request.
        $dataFromRequest = $this->getEntityDataFromRequest();
        if ($this->nullsIgnoredOnStore) {
            // Remove unspecified values, so that they are not modified.
            $dataFromRequest = array_filter(
                $dataFromRequest,
                function ($value) {
                    return !is_null($value);
                }
            );
        }
        // Update the product from the request data.
        $entity->update($dataFromRequest);
        // Store the entity.
        $entity->store();

        return $entity;
    }
protected function storeEntity()
    {
        $request = $this->getRequest();
        $id = $request->getParameter('id');
        // Try to find an existing instance of the entity.
        $entity = NULL;
        try {
            $entity = $this->getFactory()->findEntity($id);
        } catch (NotFoundException $exception) {
            // Not found? Create it.
            $className = $this->getFactory()->getEntitiesClassName();
            $entity = new $className(array(
                'id' => $id,
            ));
        }


        // Get the data from the request.
        $dataFromRequest = $this->getEntityDataFromRequest();
        if ($this->nullsIgnoredOnStore) {
            // Remove unspecified values, so that they are not modified.
            $dataFromRequest = array_filter(
                $dataFromRequest,
                function ($value) {
                    return !is_null($value);
                }
            );
        }
        // Update the product from the request data.
        $entity->update($dataFromRequest);
        // Store the entity.
        $entity->store();

        return $entity;
    }
protected function storeEntity ( ) { $ request = $ this -> getRequest ( ) ; $ id = $ request -> getParameter ( 'id' ) ; // Try to find an existing instance of the entity. $ entity = NULL ; try { $ entity = $ this -> getFactory ( ) -> findEntity ( $ id ) ; } catch ( NotFoundException $ exception ) { // Not found? Create it. $ className = $ this -> getFactory ( ) -> getEntitiesClassName ( ) ; $ entity = new $ className ( array ( 'id' => $ id , ) ) ; } // Get the data from the request. $ dataFromRequest = $ this -> getEntityDataFromRequest ( ) ; if ( $ this -> nullsIgnoredOnStore ) { // Remove unspecified values, so that they are not modified. $ dataFromRequest = array_filter ( $ dataFromRequest , function ( $ value ) { return ! is_null ( $ value ) ; } ) ; } // Update the product from the request data. $ entity -> update ( $ dataFromRequest ) ; // Store the entity. $ entity -> store ( ) ; return $ entity ; }
Updates the entity with the new data in the request and stores it.

@return Entity the stored entity
Updates the entity with the new data in the request and stores it .