Beispiel #1
0
 /**
  * Returns the zone at the index $index.
  *
  * @param int $index
  *
  * @return \StdClass|null
  *
  * @throws InvalidArgumentException
  */
 public function getZone($index)
 {
     if (false === Numeric::isPositiveInteger($index, false)) {
         throw new InvalidArgumentException('Invalid integer value.');
     }
     if (null !== ($zones = $this->getZones())) {
         if ($index < count($zones)) {
             return $zones[$index];
         }
     }
     return;
 }
Beispiel #2
0
 /**
  * Sets the position.
  * @param  integer              $position
  *
  * @return Page
  *
  * @throws InvalidArgumentException                 Raises if the value can not be cast to positive integer.
  */
 public function setPosition($position)
 {
     if (false === Numeric::isPositiveInteger($position, false)) {
         throw new InvalidArgumentException('A position must be a positive integer.');
     }
     $this->_position = $position;
     return $this;
 }
 /**
  * Sets the level.
  *
  * @param  type                                        $level
  * @return \BackBee\CoreDomain\NestedNode\AbstractNestedNode
  * @throws \BackBee\Exception\InvalidArgumentException Occurs if the value can not be cast to positive integer
  */
 public function setLevel($level)
 {
     if (false === Numeric::isPositiveInteger($level, false)) {
         throw new InvalidArgumentException('A nested level must be a positive integer.');
     }
     $this->_level = $level;
     return $this;
 }