Sulu\Bundle\ContactBundle\Entity\Position::setPosition PHP Method

setPosition() public method

Set position.
public setPosition ( string $position ) : Position
$position string
return Position
    public function setPosition($position)
    {
        $this->position = $position;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Helper function for patch action.
  *
  * @param $item
  *
  * @throws \Sulu\Component\Rest\Exception\EntityNotFoundException
  *
  * @return Position added or updated entity
  */
 private function addAndUpdateTitles($item)
 {
     if (isset($item['id']) && !empty($item['id'])) {
         /* @var Position $position */
         $position = $this->getDoctrine()->getRepository(self::$entityName)->find($item['id']);
         if ($position == null) {
             throw new EntityNotFoundException(self::$entityName, $item['id']);
         } else {
             $position->setPosition($item['position']);
         }
     } else {
         $position = new Position();
         $position->setPosition($item['position']);
         $this->getDoctrine()->getManager()->persist($position);
     }
     return $position;
 }
All Usage Examples Of Sulu\Bundle\ContactBundle\Entity\Position::setPosition