LeanMapper\Row::hasConnection PHP Метод

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

public hasConnection ( ) : boolean
Результат boolean
    public function hasConnection()
    {
        return $this->result->hasConnection();
    }

Usage Example

Пример #1
0
 /**
  * Provides dependencies
  *
  * @param IEntityFactory|null $entityFactory
  * @param Connection|null $connection
  * @param IMapper|null $mapper
  * @throws InvalidArgumentException
  * @throws InvalidStateException
  */
 public function makeAlive(IEntityFactory $entityFactory = null, Connection $connection = null, IMapper $mapper = null)
 {
     $entityFactory === null or $this->setEntityFactory($entityFactory);
     $mapper === null or $this->useMapper($mapper);
     $connection === null or $this->row->setConnection($connection);
     if ($this->entityFactory === null) {
         throw new InvalidStateException('Missing entity factory in entity ' . get_called_class() . '.');
     }
     if ($this->mapper === null) {
         throw new InvalidStateException('Missing mapper in entity ' . get_called_class() . '.');
     }
     if (!$this->row->hasConnection()) {
         throw new InvalidStateException('Missing connection in Result in entity ' . get_called_class() . '.');
     }
 }