Ejemplo n.º 1
0
 /**
  * __construct
  *
  * @param bool $id    id
  * @param bool $table table
  * @param bool $ds    data source
  *
  * @access protected
  * @return void
  */
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->virtualFields['question_count'] = sprintf('SELECT count(*) as question_count FROM survey_questions as q WHERE q.survey_id = %s.id', $this->alias);
 }
Ejemplo n.º 2
0
 /**
  * __construct
  *
  * @param bool $id    id
  * @param bool $table table
  * @param bool $ds    data source
  *
  * @access protected
  * @return void
  */
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->virtualFields['total_marks'] = sprintf('SELECT sum(multiplier) as sum FROM rubrics_criterias as rc WHERE rc.rubric_id = %s.id', $this->alias);
 }