Exemplo n.º 1
0
 /**
  * Unset an item in the array
  *
  * Required by interface ArrayAccess
  *
  * @param   int     $offset
  * @return  void
  */
 public function offsetUnset($offset)
 {
     KObjectArray::offsetUnset($offset);
 }
Exemplo n.º 2
0
 /**
  * Overridden offsetSet() method
  * 
  * All numerical array keys will be modified to start counting from zero 
  * while literal keys won't be touched.
  * 
  * @param 	int 	The offset of the item
  * @return 	object KDatabaseTRowsetAbstract
  */
 public function offsetUnset($offset)
 {
     //We need to use array_splice instead of unset to reset the keys
     array_splice($this->_data, $offset, 1);
     return parent::offsetUnset($offset);
 }
Exemplo n.º 3
0
 /**
  * Remove a property
  *
  * @param   string  $name The property name.
  * @return  KModelEntityAbstract
  */
 public function removeProperty($name)
 {
     parent::offsetUnset($name);
     unset($this->_modified[$name]);
     return $this;
 }
Exemplo n.º 4
0
 /**
  * Remove a property
  *
  * This function will reset required properties to their default value, not required properties will be unset.
  *
  * @param   string  $name The property name.
  * @return  KDatabaseRowAbstract
  */
 public function removeProperty($name)
 {
     if ($this->isConnected()) {
         $column = $this->getTable()->getColumn($name);
         if (isset($column) && $column->required) {
             $this->setProperty($this->_data[$name], $column->default);
         } else {
             parent::offsetUnset($name);
             unset($this->_modified[$name]);
         }
     }
     return $this;
 }