本文整理汇总了PHP中ORM::__set方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::__set方法的具体用法?PHP ORM::__set怎么用?PHP ORM::__set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::__set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
public function __set($prop, $value)
{
if ('name' == $prop) {
$value = url::title($value);
}
parent::__set($prop, $value);
}
示例2: __set
public function __set($col, $value)
{
if ('end_time' == $col || 'start_time' == $col) {
$value = date('Y-m-d H:i:s', strtotime($value));
}
return parent::__set($col, $value);
}
示例3: __set
public function __set($key, $value)
{
if ($key === 'password') {
$value = md5($value);
}
parent::__set($key, $value);
}
示例4: __set
/**
* Whenever setting the slug, make sure that it conforms to requirements
* @developer Brandon Hansen
* @date Oct 26, 2010
*/
public function __set($key, $value)
{
if ($key == 'slug') {
$value = format::pretty_url($value);
}
parent::__set($key, $value);
}
示例5: __set
public function __set($column, $value)
{
if ($column === 'uri') {
$value = serialize($value);
}
parent::__set($column, $value);
}
示例6: __set
public function __set($key, $value)
{
if ($key == "translated_on") {
parent::__set($key, gmdate("Y-m-d H:i:s", $value));
}
return parent::__set($key, $value);
}
示例7: __set
/**
* Override set handler to trap pointers in to_occurrence_id to occurrences that don't yet
* exist, because they come later in the submission. These values come in the form
* ||pointer||. We have to temporarily null out the field, then store the pointer for
* later.
*/
public function __set($key, $value)
{
if (substr($key, -16) === 'to_occurrence_id' && preg_match('/^||.+||$/', $value)) {
$this->to_occurrence_id_pointer = str_replace('||', '', $value);
$value = null;
}
parent::__set($key, $value);
}
示例8: __set
public function __set($key, $value)
{
if ($key === $this->config['columns']['password']) {
// Use Auth to hash the password
$value = Security::instance($this->config_name)->hash_password($value);
}
parent::__set($key, $value);
}
示例9: __set
/**
* Encrypt the data before saving, also stripping out an html
* @Developer brandon
* @Date May 18, 2010
*/
public function __set($key, $value)
{
if (in_array($key, array('content', 'title'))) {
$encrypt = new Encrypt();
$value = $encrypt->encode(strip_tags($value));
}
parent::__set($key, $value);
}
示例10: __set
public function __set($key, $value)
{
if ($key === 'password') {
// Use Auth to hash the password
$value = Auth::instance()->hash_password($value);
}
parent::__set($key, $value);
}
示例11: __set
public function __set($key, $value)
{
if ($key === 'tags') {
// Set tag to url-safe format
$value = url::title($value);
}
parent::__set($key, $value);
}
示例12: __set
public function __set($prop, $value)
{
Kohana::log('debug', $prop . ' -> ' . Kohana::debug($value));
if ('tags' == $prop && is_string($value)) {
return $this->set_tags($value);
}
return parent::__set($prop, $value);
}
示例13: __set
public function __set($prop, $value)
{
if ('user' == $prop || 'project' == $prop) {
$prop .= '_id';
$value = $value->id;
}
return parent::__set($prop, $value);
}
示例14: __set
/**
* Ensure that the rules are always followed
* @Developer brandon
* @Date Oct 12, 2010
*/
public function __set($key = NULL, $value = NULL)
{
if ($key == 'quantity') {
// Make sure that we always have a positive integer
$value = max(1, (int) $value);
}
parent::__set($key, $value);
}
示例15: __set
public function __set($key, $value)
{
# kohana::auto_load('Driver_Auth_Local');
if (!strcmp($key, 'password') or !strcmp($key, 'password_confirm')) {
$value = Model_Auth_local::hash_password($value);
}
parent::__set($key, $value);
}