Example #1
0
 /**
  * Constructor
  *
  * @param KConfig|null $config  An optional KConfig object with configuration options
  * @return \KObjectSet
  */
 public function __construct(KConfig $config = null)
 {
     //If no config is passed create it
     if (!isset($config)) {
         $config = new KConfig();
     }
     parent::__construct($config);
     if ($config->data) {
         foreach ($config->data as $object) {
             $this->insert($object);
         }
     }
 }
 /**
  * Constructor
  *
  * @param KObjectConfig  $config  An optional KObjectConfig object with configuration options
  * @return KModelEntityComposite
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_prototypable = $config->prototypable;
     $this->_identity_key = $config->identity_key;
     // Reset the collection
     $this->reset();
     // Insert the data, if exists
     if (!empty($config->data)) {
         foreach ($config->data->toArray() as $properties) {
             $this->create($properties, $config->status);
         }
     }
 }
 /**
  * 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 rowset
     $this->reset();
     // Insert the data, if exists
     if (!empty($config->data)) {
         $this->addData($config->data->toArray(), $config->new);
     }
 }
Example #4
0
 /**
  * Constructor
  *
  * @param KObjectConfig $config  An optional ObjectConfig object with configuration options
  * @return KDatabaseRowsetAbstract
  */
 public function __construct(KObjectConfig $config)
 {
     parent::__construct($config);
     $this->_prototypable = $config->prototypable;
     //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 rowset
     $this->reset();
     // Insert the data, if exists
     if (!empty($config->data)) {
         foreach ($config->data->toArray() as $properties) {
             $this->create($properties, $config->status);
         }
     }
     //Set the status message
     if (!empty($config->status_message)) {
         $this->setStatusMessage($config->status_message);
     }
 }