Blast\Orm\Mapper::__construct PHP Метод

__construct() публичный Метод

Disable direct access to mapper
public __construct ( array | ArrayObject | stdClas\stdClass | object | string $entity, Doctrine\DBAL\Driver\Connection $connection = null )
$entity array | ArrayObject | stdClas\stdClass | object | string
$connection Doctrine\DBAL\Driver\Connection
    public function __construct($entity, $connection = null)
    {
        $this->connection = $connection;
        if ($entity instanceof DefinitionInterface) {
            $this->setEntity($entity->getEntity());
            $this->definition = $entity;
        } elseif ($entity instanceof ProviderInterface) {
            $this->setEntity($entity->getEntity());
            $this->provider = $entity;
        } else {
            $this->setEntity($entity);
        }
    }