public function getPagesBySearchValue($value, $type = '')
	{
	    $select = $this->tableGateway->getSql()->select();
	    $select->columns(array('tree_page_id'));
	    
	    if ($type == 'published' || $type == ''){
	        $select->join('melis_cms_page_published', 'melis_cms_page_published.page_id = melis_cms_page_tree.tree_page_id',
	            array(), $select::JOIN_LEFT);
	    }
	        
	    
        if ($type == 'saved'){
            $select->join('melis_cms_page_saved', 'melis_cms_page_saved.page_id = melis_cms_page_tree.tree_page_id',
                array(), $select::JOIN_LEFT);
        }
        
        $select->join('melis_cms_page_style', 'melis_cms_page_tree.tree_page_id = melis_cms_page_style.pstyle_page_id', array(), $select::JOIN_LEFT);
        
        $select->join('melis_cms_style', ' melis_cms_style.style_id = melis_cms_page_style.pstyle_style_id', array('*'), $select::JOIN_LEFT);
            
        $search = '%'.$value.'%';
        $select->where->NEST->like('page_name', $search)
            ->or->like('melis_cms_page_tree.tree_page_id', $search);
        
        $resultSet = $this->tableGateway->selectWith($select);
        
        return $resultSet;
	}