/** (non-PHPdoc) * @see BaseCuePoint::preInsert() */ public function preInsert(PropelPDO $con = null) { $dbParentCuePoint = CuePointPeer::retrieveByPK($this->getParentId()); $optionalAnswers = $dbParentCuePoint->getOptionalAnswers(); $correctKeys = array(); foreach ($optionalAnswers as $answer) { if ($answer->getIsCorrect()) { $correctKeys[] = $answer->getKey(); } } $this->setCorrectAnswerKeys($correctKeys); $this->setExplanation($dbParentCuePoint->getExplanation()); $this->setIsCorrect(in_array($this->getAnswerKey(), $correctKeys)); $this->setCustomDataObj(); return parent::preInsert($con); }
public function preInsert(PropelPDO $con = null) { $subType = $this->getSubType(); if (!isset($subType)) { $this->setSubType(ThumbCuePointSubType::SLIDE); } if ($this->getSubType() == ThumbCuePointSubType::SLIDE) { $this->setStatus(CuePointStatus::PENDING); } return parent::preInsert($con); }