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 )
コード例 #1
0
ファイル: service.php プロジェクト: nergal/kohana-libs
 /**
  * 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();
 }
コード例 #2
0
ファイル: ormencrypted.php プロジェクト: rrsc/beansbooks
 /**
  * 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);
 }
コード例 #3
0
ファイル: Tag.php プロジェクト: kalenjordan/insightengine
 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();
 }
コード例 #4
0
ファイル: paris.php プロジェクト: florinp/dexonline
 /**
  * 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;
 }
コード例 #5
0
ファイル: User.php プロジェクト: peintune/Ternado
 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);
 }
コード例 #6
0
ファイル: Throttle.php プロジェクト: shomimn/builder
 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);
 }
コード例 #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);
 }