public function getQuery(core_kernel_persistence_smoothsql_SmoothModel $model, $classUri, array $propertyFilters, $and = true, $isLikeOperator = true, $lang = '', $offset = 0, $limit = 0, $order = '', $orderDir = 'ASC')
    {
        $query = $this->getGateway()->query()->setLimit( $limit )->setOffset($offset );
        
        if(!empty($order)) {
            $query->sort([$order => strtolower($orderDir)]);
        }
        
        $this->setLanguage($query , $lang);

        $criteria = $query->newQuery()
                ->add('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')
                ->in($classUri);
        
        $query->setCriteria($criteria);
        $count     = 0;
		$propertyFilters = FilterFactory::buildFilters($propertyFilters, $isLikeOperator);
		$maxLength = count($propertyFilters);
        foreach ($propertyFilters as $filter) {
        	$this->validValue($filter->getValue());

			$criteria->addCriterion($filter->getKey(), $filter->getOperator(), $this->parseValue($filter->getValue()));

			$orValues = $filter->getOrConditionValues();

			foreach ($orValues as $val) {
				$criteria->addOr($this->parseValue($val));
			}

			$count++;
			if($and === false && $maxLength > $count) {
				$criteria = $query->newQuery()
					->add('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')
					->in($classUri);
				$query->setOr($criteria);
			}
		}

        $queryString = $this->getGateway()->serialyse($query)->getQuery();

        return $queryString;
    }
public function getQuery(core_kernel_persistence_smoothsql_SmoothModel $model, $classUri, array $propertyFilters, $and = true, $isLikeOperator = true, $lang = '', $offset = 0, $limit = 0, $order = '', $orderDir = 'ASC')
    {
        $query = $this->getGateway()->query()->setLimit( $limit )->setOffset($offset );
        
        if(!empty($order)) {
            $query->sort([$order => strtolower($orderDir)]);
        }
        
        $this->setLanguage($query , $lang);

        $criteria = $query->newQuery()
                ->add('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')
                ->in($classUri);
        
        $query->setCriteria($criteria);
        $count     = 0;
		$propertyFilters = FilterFactory::buildFilters($propertyFilters, $isLikeOperator);
		$maxLength = count($propertyFilters);
        foreach ($propertyFilters as $filter) {
        	$this->validValue($filter->getValue());

			$criteria->addCriterion($filter->getKey(), $filter->getOperator(), $this->parseValue($filter->getValue()));

			$orValues = $filter->getOrConditionValues();

			foreach ($orValues as $val) {
				$criteria->addOr($this->parseValue($val));
			}

			$count++;
			if($and === false && $maxLength > $count) {
				$criteria = $query->newQuery()
					->add('http://www.w3.org/1999/02/22-rdf-syntax-ns#type')
					->in($classUri);
				$query->setOr($criteria);
			}
		}

        $queryString = $this->getGateway()->serialyse($query)->getQuery();

        return $queryString;
    }
public function getQuery ( core_kernel_persistence_smoothsql_SmoothModel $ model , $ classUri , array $ propertyFilters , $ and = true , $ isLikeOperator = true , $ lang = '' , $ offset = 0 , $ limit = 0 , $ order = '' , $ orderDir = 'ASC' ) { $ query = $ this -> getGateway ( ) -> query ( ) -> setLimit ( $ limit ) -> setOffset ( $ offset ) ; if ( ! empty ( $ order ) ) { $ query -> sort ( [ $ order => strtolower ( $ orderDir ) ] ) ; } $ this -> setLanguage ( $ query , $ lang ) ; $ criteria = $ query -> newQuery ( ) -> add ( 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' ) -> in ( $ classUri ) ; $ query -> setCriteria ( $ criteria ) ; $ count = 0 ; $ propertyFilters = FilterFactory :: buildFilters ( $ propertyFilters , $ isLikeOperator ) ; $ maxLength = count ( $ propertyFilters ) ; foreach ( $ propertyFilters as $ filter ) { $ this -> validValue ( $ filter -> getValue ( ) ) ; $ criteria -> addCriterion ( $ filter -> getKey ( ) , $ filter -> getOperator ( ) , $ this -> parseValue ( $ filter -> getValue ( ) ) ) ; $ orValues = $ filter -> getOrConditionValues ( ) ; foreach ( $ orValues as $ val ) { $ criteria -> addOr ( $ this -> parseValue ( $ val ) ) ; } $ count ++ ; if ( $ and === false && $ maxLength > $ count ) { $ criteria = $ query -> newQuery ( ) -> add ( 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' ) -> in ( $ classUri ) ; $ query -> setOr ( $ criteria ) ; } } $ queryString = $ this -> getGateway ( ) -> serialyse ( $ query ) -> getQuery ( ) ; return $ queryString ; }
serialyse a query for searchInstance
use for legacy search
@param core_kernel_persistence_smoothsql_SmoothModel $model
@param array $classUri
@param array $propertyFilters
@param boolean $and
@param boolean $isLikeOperator
@param string $lang
@param integer $offset
@param integer $limit
@param string $order
@param string $orderDir
@return string
serialyse a query for searchInstance use for legacy search