예제 #1
0
 public function load($akID)
 {
     parent::load($akID);
     $db = Loader::db();
     $row = $db->GetRow("select uakProfileDisplay, uakMemberListDisplay, displayOrder, uakProfileEdit, uakProfileEditRequired, uakRegisterEdit, uakRegisterEditRequired, uakIsActive from UserAttributeKeys where akID = ?", array($akID));
     $this->setPropertiesFromArray($row);
 }
예제 #2
0
 /** 
  * Duplicates an attribute key 
  */
 public function duplicate($args = array())
 {
     $ar = new ADODB_Active_Record('AttributeKeys');
     $ar->Load('akID=?', array($this->akID));
     $ar2 = clone $ar;
     $ar2->akID = null;
     foreach ($args as $key => $value) {
         $ar2->{$key} = $value;
     }
     $ar2->Insert();
     $db = Loader::db();
     $ak = new AttributeKey();
     $ak->load($db->Insert_ID());
     // now we duplicate the specific category fields
     $this->getController()->duplicateKey($ak);
     return $ak;
 }
예제 #3
0
파일: Key.php 프로젝트: jkoudys/concrete5
 /**
  * Duplicates an attribute key
  */
 public function duplicate($args = array())
 {
     $db = Loader::db();
     $r1 = $db->GetRow('select * from AttributeKeys where akID = ?', array($this->akID));
     unset($r1['akID']);
     $r2 = $db->insert('AttributeKeys', $r1);
     $newAKID = $db->LastInsertId();
     $ak = new AttributeKey();
     $ak->load($newAKID);
     // now we duplicate the specific category fields
     $this->getController()->duplicateKey($ak);
     return $ak;
 }