insertObjectState() абстрактный публичный Метод

Inserts a new object state into database.
abstract public insertObjectState ( eZ\Publish\SPI\Persistence\Content\ObjectState $objectState, integer $groupId )
$objectState eZ\Publish\SPI\Persistence\Content\ObjectState
$groupId integer
 /**
  * Inserts a new object state into database.
  *
  * @param \eZ\Publish\SPI\Persistence\Content\ObjectState $objectState
  * @param int $groupId
  */
 public function insertObjectState(ObjectState $objectState, $groupId)
 {
     try {
         return $this->innerGateway->insertObjectState($objectState, $groupId);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }
Пример #2
0
 /**
  * Creates a new object state in the given group.
  * The new state gets the last priority.
  * Note: in current kernel: If it is the first state all content objects will
  * set to this state.
  *
  * @param mixed $groupId
  * @param \eZ\Publish\SPI\Persistence\Content\ObjectState\InputStruct $input
  *
  * @return \eZ\Publish\SPI\Persistence\Content\ObjectState
  */
 public function create($groupId, InputStruct $input)
 {
     $objectState = $this->objectStateMapper->createObjectStateFromInputStruct($input);
     $this->objectStateGateway->insertObjectState($objectState, $groupId);
     return $objectState;
 }