/** * @param IGeoMapLocation $mapLocation * @param int $languageId */ public function __construct(IGeoMapLocation $mapLocation = NULL, $languageId = 0) { global $g_ado_db; parent::__construct($this->m_columnNames); if ($mapLocation === NULL || $languageId < 1) { return; } $this->m_data['fk_maplocation_id'] = $mapLocation->getId(); $this->m_data['fk_language_id'] = $languageId; $this->fetch(); } // fn __construct
/** * @param IGeoMapLocation $mapLocation * @param int $languageId */ public function __construct(IGeoMapLocation $mapLocation = NULL, $languageId = 0, array $p_languageSource = NULL, $p_forceExists = false) { global $g_ado_db; parent::__construct($this->m_columnNames); if ($p_languageSource) { $this->fetch($p_languageSource, $p_forceExists); return; } if ($mapLocation === NULL || $languageId < 1) { return; } $this->m_data['fk_maplocation_id'] = $mapLocation->getId(); $this->m_data['fk_language_id'] = $languageId; $this->fetch(); }
/** * Get multimedia for map location * @param IGeoMapLocation $p_mapLocation * @return array of IGeoMultimedia */ public static function GetByMapLocation(IGeoMapLocation $p_mapLocation) { global $g_ado_db; $queryStr = 'SELECT m.* FROM ' . self::TABLE . ' m INNER JOIN ' . self::TABLE_JOIN . ' mlm ON m.id = mlm.fk_multimedia_id WHERE mlm.fk_maplocation_id = ' . $p_mapLocation->getId(); $rows = $g_ado_db->GetAll($queryStr); $items = array(); foreach ((array) $rows as $row) { $items[] = new self((array) $row); } return $items; }