createLocationFromRow() public méthode

$prefix can be used to define a table prefix for the location table. Optionally pass a Location object, which will be filled with the values.
public createLocationFromRow ( array $data, string $prefix = '', eZ\Publish\SPI\Persistence\Content\Location $location = null ) : eZ\Publish\SPI\Persistence\Content\Location
$data array
$prefix string
$location eZ\Publish\SPI\Persistence\Content\Location
Résultat eZ\Publish\SPI\Persistence\Content\Location
Exemple #1
0
 /**
  * Returns an array of all trashed locations satisfying the $criterion (if provided),
  * sorted with SortClause objects contained in $sort (if any).
  * If no criterion is provided (null), no filter is applied
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
  * @param int $offset Offset to start listing from, 0 by default
  * @param int $limit Limit for the listing. Null by default (no limit)
  * @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause[] $sort
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Location\Trashed[]
  */
 public function findTrashItems(Criterion $criterion = null, $offset = 0, $limit = null, array $sort = null)
 {
     // CBA: Ignore criterion for now.
     $rows = $this->locationGateway->listTrashed($offset, $limit, $sort);
     $items = array();
     foreach ($rows as $row) {
         $items[] = $this->locationMapper->createLocationFromRow($row, null, new Trashed());
     }
     return $items;
 }
Exemple #2
0
 /**
  * @covers eZ\Publish\Core\Persistence\Legacy\Content\Location\Mapper::createLocationFromRow
  */
 public function testCreateLocationFromRowWithPrefix()
 {
     $prefix = 'some_prefix_';
     $data = array();
     foreach ($this->locationRow as $key => $val) {
         $data[$prefix . $key] = $val;
     }
     $mapper = new Mapper();
     $location = $mapper->createLocationFromRow($data, $prefix);
     $this->assertPropertiesCorrect($this->locationValues, $location);
 }
 /**
  * Loads the data for the location identified by $locationId.
  *
  * @param int $locationId
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Location
  */
 public function loadLocation($locationId)
 {
     $data = $this->locationGateway->getBasicNodeData($locationId);
     return $this->locationMapper->createLocationFromRow($data);
 }
 /**
  * Loads the data for the location identified by $remoteId.
  *
  * @param string $remoteId
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
  *
  * @return \eZ\Publish\SPI\Persistence\Content\Location
  */
 public function loadByRemoteId($remoteId)
 {
     $data = $this->locationGateway->getBasicNodeDataByRemoteId($remoteId);
     return $this->locationMapper->createLocationFromRow($data);
 }