本文整理匯總了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);
}