src/BasicDbEntityService.php
public function load(AbstractDbEntity $dbEntity)
    {
        // Check that the primary key is set
        if (!$dbEntity->getPrimaryDbValue()) {
            throw new \InvalidArgumentException(
                'Database entity can not be loaded because primary value is not set'
            );
        }

        // Fetch ad from db
        $row = $this->db->fetchRow(
            '
                SELECT *
                FROM `' . $dbEntity->getDbTableName() . '`
                WHERE ' . $this->getPrimaryKeyWhereSql($dbEntity) . '
            ',
            $this->getPrimaryKeyWhereParameters($dbEntity)
        );

        if (!$row) {
            throw new Exception\EntityNotFoundException("Db entity[{$dbEntity->getPrimaryDbValue()}] does not exist");
        }

        $dbEntity->setDbDataFromRow($row);
    }
public function load(AbstractDbEntity $dbEntity)
    {
        // Check that the primary key is set
        if (!$dbEntity->getPrimaryDbValue()) {
            throw new \InvalidArgumentException(
                'Database entity can not be loaded because primary value is not set'
            );
        }

        // Fetch ad from db
        $row = $this->db->fetchRow(
            '
                SELECT *
                FROM `' . $dbEntity->getDbTableName() . '`
                WHERE ' . $this->getPrimaryKeyWhereSql($dbEntity) . '
            ',
            $this->getPrimaryKeyWhereParameters($dbEntity)
        );

        if (!$row) {
            throw new Exception\EntityNotFoundException("Db entity[{$dbEntity->getPrimaryDbValue()}] does not exist");
        }

        $dbEntity->setDbDataFromRow($row);
    }
public function load ( AbstractDbEntity $ dbEntity ) { // Check that the primary key is set if ( ! $ dbEntity -> getPrimaryDbValue ( ) ) { throw new \ InvalidArgumentException ( 'Database entity can not be loaded because primary value is not set' ) ; } // Fetch ad from db $ row = $ this -> db -> fetchRow ( '
                SELECT *
                FROM `' . $ dbEntity -> getDbTableName ( ) . '`
                WHERE ' . $ this -> getPrimaryKeyWhereSql ( $ dbEntity ) . '
            ' , $ this -> getPrimaryKeyWhereParameters ( $ dbEntity ) ) ; if ( ! $ row ) { throw new Exception \ EntityNotFoundException ( "Db entity[{$dbEntity->getPrimaryDbValue()}] does not exist" ) ; } $ dbEntity -> setDbDataFromRow ( $ row ) ; }
Load object's values from database table.

@param AbstractDbEntity $dbEntity
@throws Exception\EntityNotFoundException
Load object s values from database table .