本文整理汇总了PHP中UserAttributeKey::load方法的典型用法代码示例。如果您正苦于以下问题:PHP UserAttributeKey::load方法的具体用法?PHP UserAttributeKey::load怎么用?PHP UserAttributeKey::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAttributeKey
的用法示例。
在下文中一共展示了UserAttributeKey::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($type, $args, $pkg = false)
{
CacheLocal::delete('user_attribute_key_by_handle', $args['akHandle']);
$ak = parent::add('user', $type, $args, $pkg);
extract($args);
if ($uakProfileDisplay != 1) {
$uakProfileDisplay = 0;
}
if ($uakMemberListDisplay != 1) {
$uakMemberListDisplay = 0;
}
if ($uakProfileEdit != 1) {
$uakProfileEdit = 0;
}
if ($uakProfileEditRequired != 1) {
$uakProfileEditRequired = 0;
}
if ($uakRegisterEdit != 1) {
$uakRegisterEdit = 0;
}
if ($uakRegisterEditRequired != 1) {
$uakRegisterEditRequired = 0;
}
if (isset($uakIsActive) && !$uakIsActive) {
$uakIsActive = 0;
} else {
$uakIsActive = 1;
}
$db = Loader::db();
$displayOrder = $db->GetOne('select max(displayOrder) from UserAttributeKeys');
if (!$displayOrder) {
$displayOrder = 0;
}
$displayOrder++;
$v = array($ak->getAttributeKeyID(), $uakProfileDisplay, $uakMemberListDisplay, $uakProfileEdit, $uakProfileEditRequired, $uakRegisterEdit, $uakRegisterEditRequired, $displayOrder, $uakIsActive);
$db->Execute('insert into UserAttributeKeys (akID, uakProfileDisplay, uakMemberListDisplay, uakProfileEdit, uakProfileEditRequired, uakRegisterEdit, uakRegisterEditRequired, displayOrder, uakIsActive) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', $v);
$nak = new UserAttributeKey();
$nak->load($ak->getAttributeKeyID());
return $nak;
}