本文整理汇总了PHP中CActiveRecord::findByAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::findByAttributes方法的具体用法?PHP CActiveRecord::findByAttributes怎么用?PHP CActiveRecord::findByAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::findByAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findByAttributes
/**
* findByAttributes
*/
public function findByAttributes($attributes, $condition = '', $params = array())
{
foreach ($attributes as $attribute => $value) {
if (in_array($attribute, $this->encrypt)) {
$attributes[$attribute] = $this->encryptDecrypt($value);
}
}
return parent::findByAttributes($attributes, $condition, $params);
}
示例2: findByAttributes
/**
*
* @param array $attributes
* @param string $condition
* @param array $params
* @return CStubActiveRecord
*/
public function findByAttributes($attributes, $condition = '', $params = array())
{
if (CStubActiveRecord::isUnittests()) {
return CallFactory::call($this, 'findByAttributes');
}
return parent::findByAttributes($attributes, $condition, $params);
}
示例3: findByAttributes
public function findByAttributes($attributes, $condition = '', $params = array())
{
return $this->prepareRecord(parent::findByAttributes($attributes, $this->prepareCondition($condition), $params));
}
示例4: findByAttributes
/**
*
* Overriding parent implementation to allow transforming of the ip_address attribute from human readable format
* to db level format (varbinary(16) is the column data type).
*
* @param array $attributes
* @param mixed $condition
* @param array $params
*
* @return PageViewBookeeping
*/
public function findByAttributes($attributes, $condition = '', $params = array())
{
foreach ($attributes as $attr_name => $value) {
if ($attr_name === 'ip_address') {
// transform the IP from human readable format to varbinary
$attributes[$attr_name] = inet_pton($value);
break;
}
}
return parent::findByAttributes($attributes, $condition, $params);
}