Example #1
0
 /**
  * Set/change the priority of an element
  *
  * @return Fieldset
  * @throws \Nmwdhj\Exception
  * @since 1.3
  */
 public function set_priority($key, $priority)
 {
     if (!$this->has($key)) {
         throw new Exception('No element with the given name is found');
     }
     $this->elements->offsetSet($key, $this->elements[$key], $priority);
     return $this;
 }
Example #2
0
 private function wrap($name, $model, WebRequest $dispatched, WebRequest $wrapped)
 {
     $wrapper = new Wrapper($name, $dispatched->getTarget(), $wrapped->getArguments());
     if ($this->isMapping()) {
         $wrapper->except($this->mappedBox);
     }
     $model = $wrapper->wrap($model);
     $this->onLoadHandler .= $wrapper->getOnLoadHandler();
     $this->heads->putAll($wrapper->getHeadElements());
     return $model;
 }
Example #3
0
 /**
  * Gets SK ITC Bundle DTD Document Element
  *
  * @param string $name
  *        	SK ITC Bundle DTD Document Element Name
  * @return \SK\ITCBundle\ORM\DTD\Element[]
  */
 public function getElement($name = null)
 {
     if (NULL === $this->element) {
         $this->element = new \ArrayIterator();
     }
     if (NULL !== $name) {
         if (!$this->getElement()->offsetExists($name)) {
             $source = $this->getSource()->getElement($name);
             $element = new Element($this, $name, $source);
             $this->setElement($element);
         }
         return $this->element->offsetGet($name);
     } else {
         foreach ($this->getSource()->getElement() as $name => $source) {
             $element = new Element($this, $name, $source);
             $this->setElement($element);
         }
     }
     return $this->element;
 }
Example #4
0
 /**
  * @return bool
  */
 public function hasElements()
 {
     return $this->elements->count() > 0;
 }