eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::update PHP Method

update() public method

Will not throw anything if location id is invalid or no entries are affected.
public update ( eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct $location, integer $locationId )
$location eZ\Publish\SPI\Persistence\Content\Location\UpdateStruct
$locationId integer
    public function update(UpdateStruct $location, $locationId)
    {
        $query = $this->handler->createUpdateQuery();
        $query->update($this->handler->quoteTable('ezcontentobject_tree'))->set($this->handler->quoteColumn('priority'), $query->bindValue($location->priority))->set($this->handler->quoteColumn('remote_id'), $query->bindValue($location->remoteId))->set($this->handler->quoteColumn('sort_order'), $query->bindValue($location->sortOrder))->set($this->handler->quoteColumn('sort_field'), $query->bindValue($location->sortField))->where($query->expr->eq($this->handler->quoteColumn('node_id'), $locationId));
        $statement = $query->prepare();
        $statement->execute();
        // Commented due to EZP-23302: Update Location fails if no change is performed with the update
        // Should be fixed with PDO::MYSQL_ATTR_FOUND_ROWS instead
        /*if ( $statement->rowCount() < 1 )
          {
              throw new NotFound( 'location', $locationId );
          }*/
    }