public static function LoadByIdContestEntry($intidFormAnswer) { $sql = sprintf("SELECT * FROM %s WHERE idContestEntry = %s;", self::TABLE_NAME, $intidFormAnswer); $result = LoadDriver::query($sql); $coll = new BaseEntityCollection(); while ($data = mysql_fetch_assoc($result)) { $tObj = new ContestFormAnswer(); $tObj->materilize($data); $coll->addItem($tObj); } return $coll; }
public static function AddEntry($arrEntryData) { if (!FBContestApplication::CanSubmit()) { return false; } $objEntry = new ContestEntry(); $objEntry->fbuid = FBContestApplication::FBUid(); $objEntry->creDate = MFBDateTime::Now(); $objEntry->Save(); foreach ($arrEntryData as $strName => $arrData) { $objEntryAnswer = new ContestFormAnswer(); $objEntryAnswer->idContestEntry = $objEntry->idContestEntry; $objEntryAnswer->name = $strName; $objEntryAnswer->idContestFormFieldType = $arrData['type']; $objEntryAnswer->value = $arrData['value']; $objEntryAnswer->save(); } return true; }
public function GetContestFormAnswerAsIdArray() { return ContestFormAnswer::LoadByIdContestEntry($this->idContestEntry)->getCollection(); }