yii\db\DataReader::readObject PHP Метод

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

Returns an object populated with the next row of data.
public readObject ( string $className, array $fields ) : mixed
$className string class name of the object to be created and populated
$fields array Elements of this array are passed to the constructor
Результат mixed the populated object, false if no more row of data available
    public function readObject($className, $fields)
    {
        return $this->_statement->fetchObject($className, $fields);
    }

Usage Example

Пример #1
0
 /**
  * Returns an object populated with the next row of data.
  * @param string $className class name of the object to be created and populated
  * @param array $fields Elements of this array are passed to the constructor
  * @return mixed the populated object, false if no more row of data available
  */
 public function readObject($className, $fields)
 {
     //Try..Catch to prevent Function sequence error: -11067
     try {
         return parent::readObject($className, $fields);
     } catch (\Exception $ex) {
     }
     return false;
 }
All Usage Examples Of yii\db\DataReader::readObject