Esempio n. 1
0
 public static function add($type, $args, $pkg = false)
 {
     $ak = parent::add('store_product', $type, $args, $pkg);
     extract($args);
     $v = array($ak->getAttributeKeyID());
     $db = Database::get();
     $db->Execute('REPLACE INTO VividStoreProductAttributeKeys (akID) VALUES (?)', $v);
     $nak = new StoreProductKey();
     $nak->load($ak->getAttributeKeyID());
     return $ak;
 }
Esempio n. 2
0
 public static function add($at, $args, $pkg = false)
 {
     // legacy check
     $fargs = func_get_args();
     if (count($fargs) >= 5) {
         $at = $fargs[4];
         $pkg = false;
         $args = array('akHandle' => $fargs[0], 'akName' => $fargs[1], 'akIsSearchable' => $fargs[2]);
     }
     CacheLocal::delete('collection_attribute_key_by_handle', $args['akHandle']);
     $ak = parent::add(self::getCategoryTypeName(), $at, $args, $pkg);
     return $ak;
 }
Esempio n. 3
0
 public static 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 static();
     $nak->load($ak->getAttributeKeyID());
     return $nak;
 }
 public static function add($at, $args, $pkg = false)
 {
     // legacy check
     $fargs = func_get_args();
     if (count($fargs) >= 5) {
         $at = $fargs[4];
         $pkg = false;
         $args = array('akHandle' => $fargs[0], 'akName' => $fargs[1], 'akIsSearchable' => $fargs[2]);
     }
     $ak = parent::add('attribute_form', $at, $args, $pkg);
     return $ak;
 }
Esempio n. 5
0
 public static function add($at, $args, $pkg = false)
 {
     CacheLocal::delete('file_attribute_key_by_handle', $args['akHandle']);
     $ak = parent::add('file', $at, $args, $pkg);
     return $ak;
 }
Esempio n. 6
0
 protected static function add($at, $args, $pkg = false)
 {
     // legacy check
     $fargs = func_get_args();
     if (count($fargs) >= 5) {
         $at = $fargs[4];
         $pkg = false;
         $args = array('akHandle' => $fargs[0], 'akName' => $fargs[1], 'akIsSearchable' => $fargs[2]);
     }
     CacheLocal::delete('form_attribute_key_by_handle', $args['akHandle']);
     $ak = parent::add('form', $at, $args, $pkg);
     return $ak;
 }