Esempio n. 1
0
 static function create(IRequest $Request, AbstractAccountType $Account)
 {
     $id = strtoupper(uniqid(self::ID_PREFIX));
     $Account->setID($id);
     $inserted = self::table()->insert(array(AccountTable::COLUMN_ID => $id, AccountTable::COLUMN_NAME => $Account->getAccountName(), AccountTable::COLUMN_EMAIL => $Account->getAccountEmail(), AccountTable::COLUMN_STATUS => 0, AccountTable::COLUMN_CREATED => time(), AccountTable::COLUMN_ACCOUNT => serialize($Account)))->execute($Request);
     if (!$inserted) {
         throw new \InvalidArgumentException("Could not insert " . __CLASS__);
     }
     $Request->log("New Account Entry Inserted: " . $id, $Request::VERBOSE);
     return $id;
 }