src/AbstractMapper.php
public function insert($entity)
    {
        if (!$entity instanceof $this->entityClass) {
            throw new \InvalidArgumentException(
                "The entity to be inserted must be an instance of {$this->entityClass}."
            );
        }

        return $this->adapter->insert($this->entityTable, $entity->toArray());
    }
public function insert($entity)
    {
        if (!$entity instanceof $this->entityClass) {
            throw new \InvalidArgumentException(
                "The entity to be inserted must be an instance of {$this->entityClass}."
            );
        }

        return $this->adapter->insert($this->entityTable, $entity->toArray());
    }
public function insert ( $ entity ) { if ( ! $ entity instanceof $ this -> entityClass ) { throw new \ InvalidArgumentException ( "The entity to be inserted must be an instance of {$this->entityClass}." ) ; } return $ this -> adapter -> insert ( $ this -> entityTable , $ entity -> toArray ( ) ) ; }
Insert a new entity in the storage
@param AbstractEntity $entity
@return mixed
Insert a new entity in the storage