/**
  * @param ActivityListModel $model - the model to encode
  * @param ProjectModel $projectModel
  * @return array
  */
 public static function encodeModel($model, $projectModel)
 {
     /* Note: I had to change the name of this static method to something else besides 'encode' because
      * PHP complained about the signature not being the same as the parent class JsonEncoder
      * cjh 2013-08
      */
     $e = new ActivityListDtoEncoder($projectModel);
     return $e->_encode($model);
 }
Ejemplo n.º 2
0
 /**
  * @param string $projectModel
  * @param string $questionId
  * @return array - the DTO array
  */
 public static function getActivityForProject($projectModel)
 {
     $activityList = new ActivityListModel($projectModel);
     $activityList->readAsModels();
     $dto = ActivityListDtoEncoder::encodeModel($activityList, $projectModel);
     self::prepareDto($dto);
     return is_array($dto['entries']) ? $dto['entries'] : array();
 }