public function getSites($env = '', $includeSite404Table = false)
	{
		$select = $this->tableGateway->getSql()->select();
		
		$select->columns(array('*'));
	
		if($includeSite404Table) {
		    $select->join('melis_cms_site_domain', 'melis_cms_site_domain.sdom_site_id = melis_cms_site.site_id',
		        array('*'), $select::JOIN_LEFT)
		        ->join('melis_cms_site_404', 'melis_cms_site_404.s404_site_id = melis_cms_site.site_id',
		            array('*'), $select::JOIN_LEFT);
		}
		else {
		    $select->join('melis_cms_site_domain', 'melis_cms_site_domain.sdom_site_id = melis_cms_site.site_id',
		        array('*'), $select::JOIN_LEFT);
		}


		if ($env != '')
			$select->where("sdom_env = '$env'");
			
		$resultSet = $this->tableGateway->selectWith($select);
	
		return $resultSet;
	}