예제 #1
0
파일: Module.php 프로젝트: m3uzz/onionfw
 /**
  * Add an existent Options object to the array object.
  * If $pnPosition is int value, the object will be inserted in this array
  * positon.
  * Else, if $psIndex is given, it will be used to set the array key.
  * Or by default the array key will be the object id property.
  *
  * @param Onion\Application\Element\Options $poOptions
  * @param string $psIndex
  * @param string $pnPosition
  * @throws Exception
  * @return Onion\Application\Module
  */
 public function addOptions($poOptions, $psIndex = null, $pnPosition = null)
 {
     if ($poOptions instanceof Options) {
         return parent::add('_options', $poOptions, $psIndex, $pnPosition, true);
     } else {
         throw new Exception('$poOptions should be a instance of Onion\\Application\\Element\\Options!');
     }
 }
예제 #2
0
파일: Section.php 프로젝트: m3uzz/onionfw
 /**
  * Add an existent Module object to the array object.
  * If $pnPosition is int value, the object will be inserted in this array
  * positon.
  * Else, if $psIndex is given, it will be used to set the array key.
  * Or by default the array key will be the object id property.
  *
  * @param Onion\Application\Module $poModule
  * @param string $psIndex
  * @param string $pnPosition
  * @throws Exception
  * @return Onion\Application\Section
  */
 public function addOption($poModule, $psIndex = null, $pnPosition = null)
 {
     if ($poModule instanceof Module) {
         return parent::add('_options', $poModule, $psIndex, $pnPosition);
     } else {
         throw new Exception('$poModule should be a instance of Onion\\Application\\Module!');
     }
 }
예제 #3
0
파일: Action.php 프로젝트: m3uzz/onionfw
 /**
  * Add an existent Filter object to the array object.
  * If $pnPosition is int value, the object will be inserted in this array
  * positon.
  * Else, if $psIndex is given, it will be used to set the array key.
  * Or by default the array key will be the object id property.
  *
  * @param Onion\Application\Element\Filter $poFilter
  * @param string $psIndex
  * @param string $pnPosition
  * @throws Exception
  * @return Onion\Application\Action
  */
 public function addFilter($poFilter, $psIndex = null, $pnPosition = null)
 {
     if ($poFilter instanceof Filter) {
         return parent::add('_filter', $poFilter, $psIndex, $pnPosition, true);
     } else {
         throw new Exception('$poFilter should be a instance of Onion\\Application\\Element\\Filter!');
     }
 }
예제 #4
0
파일: Options.php 프로젝트: m3uzz/onionfw
 /**
  * Add a separate to the array object.
  * If $pnPosition is int value, the object will be inserted in this array
  * positon.
  * Else, if $psIndex is given, it will be used to set the array key.
  * Or by default the array key will be the object id property.
  *
  * @param string $pnIndex
  * @param string $pnPosition
  * @return Onion\Application\Element\Options
  */
 public function addSeparate($pnIndex = null, $pnPosition = null)
 {
     return parent::add('_itens', null, $pnIndex, $pnPosition, true);
 }