Esempio n. 1
0
 /**
  * Constructor
  *
  * @param   object  An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config = null)
 {
     //If no config is passed create it
     if (!isset($config)) {
         $config = new KConfig();
     }
     parent::__construct($config);
     // Set the table indentifier
     if (isset($config->identity_column)) {
         $this->_identity_column = $config->identity_column;
     }
     // Reset the row
     $this->reset();
     // Set the new state of the row
     $this->_new = $config->new;
     // Set the row data
     if (isset($config->data)) {
         $this->setData((array) KConfig::unbox($config->data), $this->_new);
     }
     //Set the status
     if (isset($config->status)) {
         $this->setStatus($config->status);
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->setStatusMessage($config->status_message);
     }
 }
Esempio n. 2
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional KObjectConfig object with configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $headers = KObjectConfig::unbox($config->headers);
     foreach ($headers as $key => $values) {
         $this->set($key, $values);
     }
 }
Esempio n. 3
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional ObjectConfig object with configuration options
  * @return  KUserSessionContainerAbstract
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set the attribute session namespace
     $this->setNamespace($config->namespace);
     //Set the attribute session separator
     $this->_separator = $config->separator;
 }
Esempio n. 4
0
 /**
  * Constructor
  *
  * @param 	object 	An optional KConfig object with configuration options.
  */
 public function __construct(KConfig $config = null)
 {
     //If no config is passed create it
     if (!isset($config)) {
         $config = new KConfig();
     }
     parent::__construct($config);
     $data = is_a($config->data, 'KConfig') ? $config->data->toArray() : $config->data;
     $this->_data = $data;
 }
Esempio n. 5
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config An optional KObjectConfig object with configuration options
  * @throws UnexpectedValueException
  * @throws InvalidArgumentException
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     if (empty($config->model)) {
         throw new InvalidArgumentException('model [KModelInterface] config option is required');
     }
     if (!$config->model instanceof KModelInterface) {
         throw new UnexpectedValueException('Model: ' . get_class($config->model) . ' does not implement KModelInterface');
     }
     $this->__model = $config->model;
 }
Esempio n. 6
0
 /**
  * Constructor
  *
  * @param  KObjectConfig $config  An optional KObjectConfig object with configuration options.
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_identity_key = $config->identity_key;
     // Reset the entity
     $this->reset();
     //Set the status
     if (isset($config->status)) {
         $this->setStatus($config->status);
     }
     // Set the entity data
     if (isset($config->data)) {
         $this->setProperties($config->data->toArray(), $this->isNew());
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->setStatusMessage($config->status_message);
     }
 }
Esempio n. 7
0
 /**
  * Constructor
  *
  * @param  KObjectConfig $config  An optional ObjectConfig object with configuration options.
  */
 public function __construct(KObjectConfig $config)
 {
     KObjectArray::__construct($config);
     $this->_identity_key = $config->identity_key;
     //Set the status
     if (isset($config->status)) {
         $this->_status = $config->status;
     }
     // Set the entity data
     if (isset($config->data)) {
         $this->_data = $config->data->toArray();
     } else {
         $this->_data = array();
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->_status_message = $config->status_message;
     }
 }
Esempio n. 8
0
 /**
  * Constructor
  *
  * @param  KObjectConfig $config  An optional ObjectConfig object with configuration options.
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Set the table identifier
     $this->_table = $config->table;
     // Set the table identifier
     if (isset($config->identity_column)) {
         $this->_identity_column = $config->identity_column;
     }
     // Reset the row
     $this->reset();
     //Set the status
     if (isset($config->status)) {
         $this->setStatus($config->status);
     }
     // Set the row data
     if (isset($config->data)) {
         $this->setProperties($config->data->toArray(), $this->isNew());
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->setStatusMessage($config->status_message);
     }
 }
Esempio n. 9
0
 public function __construct(KObjectConfig $config)
 {
     $config->append(array('data' => array('deleted' => false, 'internal' => false, 'attachments' => array(), 'downstreamDuplicates' => array(), 'upstreamDuplicates' => array(), 'attributes' => array())));
     parent::__construct($config);
 }
Esempio n. 10
0
 /**
  * Prepares for rendering by loading classes
  *
  * @param	KConfig		$config		object of configurations
  */
 public function __construct(KConfig $config)
 {
     KLoader::load('lib.joomla.module.helper');
     $this->renderer = KFactory::get('lib.joomla.document')->loadRenderer('module');
     parent::__construct($config);
 }
Esempio n. 11
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional ObjectConfig object with configuration options
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     //Add the parameters
     $this->add(KObjectConfig::unbox($config->parameters));
 }
Esempio n. 12
0
 /**
  * Constructor
  *
  * @param	array An optional associative array of configuration settings.
  */
 public function __construct(KConfig $options)
 {
     $this->_identifier = $options->identifier;
     parent::__construct($options);
     //$options  = $this->_initialize($options);
 }