示例#1
0
 /**
  * Constructs the class
  *
  * @param   mixed  $properties  Either and associative array or another
  *                              object to set the initial properties of the object.
  */
 public function __construct($properties = null)
 {
     parent::__construct($properties);
     if (func_num_args() == 2) {
         $this->setAdapter(func_get_arg(1));
     }
 }
示例#2
0
 /**
  * Class constructor
  *
  * @param   array  $options  An array of configuration options.
  * @return  void
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Load the menu items
     $this->load();
     foreach ($this->_items as $item) {
         if ($item->home) {
             $this->_default[trim($item->language)] = $item->id;
         }
         // Decode the item params
         $item->params = new Registry($item->params);
     }
 }
示例#3
0
 /**
  * Constructor
  *
  * @param   array  $config  An array of configuration options
  * @return  void
  */
 public function __construct($config = array())
 {
     parent::__construct();
     // Set the model state
     if (array_key_exists('state', $config)) {
         $this->state = $config['state'];
     } else {
         $this->state = new Object();
     }
     // Set the model dbo
     if (array_key_exists('dbo', $config)) {
         $this->db = $config['dbo'];
     } else {
         $this->db = App::get('db');
     }
     // Set the internal state marker - used to ignore setting state from the request
     if (!empty($config['ignore_request'])) {
         $this->__state_set = true;
     }
 }
示例#4
0
 /**
  * Class constructor.
  *
  * @param   array  $options  Associative array of options
  * @return  void
  */
 public function __construct($options = array())
 {
     parent::__construct();
     if (array_key_exists('lineend', $options)) {
         $this->setLineEnd($options['lineend']);
     }
     if (array_key_exists('charset', $options)) {
         $this->setCharset($options['charset']);
     }
     if (array_key_exists('language', $options)) {
         $this->setLanguage($options['language']);
     }
     if (array_key_exists('direction', $options)) {
         $this->setDirection($options['direction']);
     }
     if (array_key_exists('tab', $options)) {
         $this->setTab($options['tab']);
     }
     if (array_key_exists('link', $options)) {
         $this->setLink($options['link']);
     }
     if (array_key_exists('base', $options)) {
         $this->setBase($options['base']);
     }
 }