Пример #1
0
 /**
  * Return the scalars for a given submission.
  *
  * @param Tracker_SubmissionDao $submissionDao submission DAO
  * @return array scalar DAOs
  */
 public function getScalars($submissionDao)
 {
     $sql = $this->database->select()->setIntegrityCheck(false)->from('tracker_scalar')->where('submission_id = ?', $submissionDao->getKey());
     $scalarDaos = array();
     $rows = $this->database->fetchAll($sql);
     /** @var Zend_Db_Table_Row_Abstract $row */
     foreach ($rows as $row) {
         $scalarDaos[] = $this->initDao('Scalar', $row, $this->moduleName);
     }
     return $scalarDaos;
 }
Пример #2
0
 /**
  * Convert the given submission DAO to an array.
  *
  * @param Tracker_SubmissionDao $submissionDao submission DAO
  * @return array associative array representation of the submission DAO
  */
 protected function _toArray($submissionDao)
 {
     $submissionArray = array('_id' => $submissionDao->getKey(), '_type' => 'Tracker_Submission');
     return array_merge($submissionArray, $submissionDao->toArray());
 }