本文整理汇总了PHP中ORM::set方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::set方法的具体用法?PHP ORM::set怎么用?PHP ORM::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::set方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* 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: set
/**
* 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: processSubjectLine
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: set
/**
* 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: set
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: set
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: set
/**
* 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);
}