Example #1
0
 /**
  * Adds a generic attribute record (with this type) to the AttributeValues table
  */
 public function addAttributeValue()
 {
     $db = Loader::db();
     $u = new User();
     $dh = Loader::helper('date');
     $uID = $u->isRegistered() ? $u->getUserID() : 0;
     $avDate = $dh->getOverridableNow();
     $v = array($this->atID, $this->akID, $uID, $avDate);
     $db->Execute('insert into AttributeValues (atID, akID,  uID, avDateAdded) values (?, ?, ?, ?)', $v);
     $avID = $db->Insert_ID();
     return AttributeValue::getByID($avID);
 }
Example #2
0
 /**
  * Adds a generic attribute record (with this type) to the AttributeValues table.
  */
 public function addAttributeValue()
 {
     $db = Database::connection();
     $u = new User();
     $dh = Core::make('helper/date');
     $uID = $u->isRegistered() ? $u->getUserID() : 0;
     $avDate = $dh->getOverridableNow();
     $v = array($this->atID, $this->akID, $uID, $avDate);
     $db->executeQuery('insert into AttributeValues (atID, akID,  uID, avDateAdded) values (?, ?, ?, ?)', $v);
     $avID = $db->lastInsertId();
     return AttributeValue::getByID($avID);
 }