convertToBeans() public method

New in 4.3.2: meta mask. The meta mask is a special mask to send data from raw result rows to the meta store of the bean. This is useful for bundling additional information with custom queries. Values of every column whos name starts with $mask will be transferred to the meta section of the bean under key 'data.bundle'.
public convertToBeans ( string $type, array $rows, string $mask = NULL ) : array
$type string type of beans you would like to have
$rows array rows from the database result
$mask string meta mask to apply (optional)
return array
示例#1
0
 /**
  * Returns the next bean in the collection.
  * If called the first time, this will return the first bean in the collection.
  * If there are no more beans left in the collection, this method
  * will return NULL.
  *
  * @return OODBBean|NULL
  */
 public function next()
 {
     $row = $this->cursor->getNextItem();
     if ($row) {
         $beans = $this->repository->convertToBeans($this->type, array($row));
         $bean = array_shift($beans);
         return $bean;
     }
     return NULL;
 }
示例#2
0
 /**
  * This is a convenience method; it converts database rows
  * (arrays) into beans. Given a type and a set of rows this method
  * will return an array of beans of the specified type loaded with
  * the data fields provided by the result set from the database.
  *
  * @param string $type type of beans you would like to have
  * @param array  $rows rows from the database result
  *
  * @return array
  */
 public function convertToBeans($type, $rows)
 {
     return $this->repository->convertToBeans($type, $rows);
 }
示例#3
0
 /**
  * This is a convenience method; it converts database rows
  * (arrays) into beans. Given a type and a set of rows this method
  * will return an array of beans of the specified type loaded with
  * the data fields provided by the result set from the database.
  *
  * @param string $type type of beans you would like to have
  * @param array  $rows rows from the database result
  * @param string $mask mask to apply for meta data
  *
  * @return array
  */
 public function convertToBeans($type, $rows, $mask = NULL)
 {
     return $this->repository->convertToBeans($type, $rows, $mask);
 }