src/CRUDlex/AbstractData.php
public function create(Entity $entity)
    {
        $result = $this->events->shouldExecute($entity, 'before', 'create');
        if (!$result) {
            return false;
        }
        $result = $this->doCreate($entity);
        $this->events->shouldExecute($entity, 'after', 'create');
        return $result;
    }
public function create(Entity $entity)
    {
        $result = $this->events->shouldExecute($entity, 'before', 'create');
        if (!$result) {
            return false;
        }
        $result = $this->doCreate($entity);
        $this->events->shouldExecute($entity, 'after', 'create');
        return $result;
    }
public function create ( Entity $ entity ) { $ result = $ this -> events -> shouldExecute ( $ entity , 'before' , 'create' ) ; if ( ! $ result ) { return false ; } $ result = $ this -> doCreate ( $ entity ) ; $ this -> events -> shouldExecute ( $ entity , 'after' , 'create' ) ; return $ result ; }
Persists the given entity as new entry in the datasource.

@param Entity $entity
the entity to persist

@return boolean
true on successful creation
Persists the given entity as new entry in the datasource .