/** * Retrieve all editions for a specific project * * @param integer $project_id * * @return array */ public static function getAllByProjectID($project_id) { if (self::$_editions === null) { self::$_editions = array(); } if (!array_key_exists($project_id, self::$_editions)) { self::$_editions[$project_id] = array(); if ($res = B2DB::getTable('TBGEditionsTable')->getByProjectID($project_id)) { while ($row = $res->getNextRow()) { $edition = TBGContext::factory()->TBGEdition($row->get(TBGEditionsTable::ID), $row); self::$_editions[$project_id][$edition->getID()] = $edition; } } } return self::$_editions[$project_id]; }