set() public method

To set multiple properties at once, pass an associative array as the first parameter and leave out the second parameter. Flags the properties as 'dirty' so they will be saved to the database when save() is called.
public set ( $key, $value = null )
Ejemplo n.º 1
0
 /**
  * Create operation
  *
  * @param  array $data
  * @return ORM
  */
 public function create(array $data = array())
 {
     foreach ($data as $column => $value) {
         $this->orm->set($column, $value);
     }
     return $this->orm->save();
 }
Ejemplo n.º 2
0
 /**
  * Necesarry override to enable per-column encryption.
  * @param String $column
  * @param mixed $value 
  */
 public function set($column, $value)
 {
     if (in_array($column, $this->_encrypted_compressed_columns)) {
         return parent::set($column, Encrypt::instance()->encode(gzcompress($value, 1)));
     }
     if (in_array($column, $this->_encrypted_columns)) {
         return parent::set($column, Encrypt::instance()->encode($value));
     }
     return parent::set($column, $value);
 }
Ejemplo n.º 3
0
 public function processSubjectLine()
 {
     if (!isset($this->_tagModel)) {
         throw new Exception("Tag data hasn't been loaded yet");
     }
     $session = $this->getSession();
     $mandrill = new Model_Mandrill();
     $mandrill->setKey($session->getKey());
     try {
         $lastMessage = $mandrill->fetchLastMessage($this->getTag());
         $subject = isset($lastMessage['subject']) ? $lastMessage['subject'] : "Not found";
     } catch (Exception $e) {
         $subject = null;
     }
     $this->_tagModel->set('tag_subject', $subject)->save();
 }
Ejemplo n.º 4
0
 /**
  * Setter method, allows $model->set('property', 'value') access to data.
  *
  * @param  string|array $property
  * @param  string|null  $value
  * @return void
  */
 public function set($property, $value = null)
 {
     $this->orm->set($property, $value);
     return $this;
 }
Ejemplo n.º 5
0
 public function set($column, $value)
 {
     $dates = array('activated_at', 'last_login');
     if (in_array($column, $dates) and is_a($value, 'DateTime')) {
         $value = $value->format('Y-m-d H:i:s');
     } else {
         if (in_array($column, $this->hashableAttributes) and !empty($value)) {
             $value = $this->hash($value);
         }
     }
     parent::set($column, $value);
 }
Ejemplo n.º 6
0
 public function set($column, $value)
 {
     $dates = array('last_attempt_at', 'suspended_at', 'banned_at');
     if (in_array($column, $dates) and is_a($value, 'DateTime')) {
         $value = $value->format('Y-m-d H:i:s');
     }
     return parent::set($column, $value);
 }
Ejemplo n.º 7
0
 /**
  * Handles setting of column
  *
  * @param  string $column Column name
  * @param  mixed  $value  Column value
  * @return void
  */
 public function set($column, $value)
 {
     if ($column == $this->scope_column and !$this->use_scope) {
         return;
     }
     parent::set($column, $value);
 }