src/Budkit/Datastore/Model/Entity.php
public function getObjectsByPropertyValueMatch(array $properties, array $values, array $select = array(), $objectType = NULL, $objectURI = NULL, $objectId = NULL)
    {

        if (empty($properties) || empty($values))
            return false; //We must have eactly one property value pair defined 
        $select = array_merge($properties, $select); //If we have an empty select use the values from property;
        $query = static::getObjectQuery($select, "?{$this->valueGroup}property_values", $objectId, $objectType, $objectType);

        $query .= "\nGROUP BY o.object_id";
        $p = count($properties);
        $v = count($values);
        if (!empty($properties) && !empty($values) && $p === $v):
            $query .= "\nHAVING\t";
            $having = false;
            for ($i = 0; $i < $p; $i++):
                $query .= ($having) ? "\tAND\t" : "";
                $query .= "{$properties[$i]} = " . $this->database->quote($values[$i]);
                $having = true;
            endfor;
        endif;

        $results = $this->database->prepare($query)->execute();

        return $results;
    }
public function getObjectsByPropertyValueMatch(array $properties, array $values, array $select = array(), $objectType = NULL, $objectURI = NULL, $objectId = NULL)
    {

        if (empty($properties) || empty($values))
            return false; //We must have eactly one property value pair defined 
        $select = array_merge($properties, $select); //If we have an empty select use the values from property;
        $query = static::getObjectQuery($select, "?{$this->valueGroup}property_values", $objectId, $objectType, $objectType);

        $query .= "\nGROUP BY o.object_id";
        $p = count($properties);
        $v = count($values);
        if (!empty($properties) && !empty($values) && $p === $v):
            $query .= "\nHAVING\t";
            $having = false;
            for ($i = 0; $i < $p; $i++):
                $query .= ($having) ? "\tAND\t" : "";
                $query .= "{$properties[$i]} = " . $this->database->quote($values[$i]);
                $having = true;
            endfor;
        endif;

        $results = $this->database->prepare($query)->execute();

        return $results;
    }
public function getObjectsByPropertyValueMatch ( array $ properties , array $ values , array $ select = array ( ) , $ objectType = NULL , $ objectURI = NULL , $ objectId = NULL ) { if ( empty ( $ properties ) || empty ( $ values ) ) return false ; //We must have eactly one property value pair defined  $ select = array_merge ( $ properties , $ select ) ; //If we have an empty select use the values from property; $ query = static :: getObjectQuery ( $ select , "?{$this->valueGroup}property_values" , $ objectId , $ objectType , $ objectType ) ; $ query .= "\nGROUP BY o.object_id" ; $ p = count ( $ properties ) ; $ v = count ( $ values ) ; if ( ! empty ( $ properties ) && ! empty ( $ values ) && $ p === $ v ) : $ query .= "\nHAVING\t" ; $ having = false ; for ( $ i = 0 ; $ i < $ p ; $ i ++ ) : $ query .= ( $ having ) ? "\tAND\t" : "" ; $ query .= "{$properties[$i]} = " . $ this -> database -> quote ( $ values [ $ i ] ) ; $ having = true ; endfor ; endif ; $ results = $ this -> database -> prepare ( $ query ) -> execute ( ) ; return $ results ; }
Return Object lists with properties matching the given value

@param type $properties list of properties to match to values, must have exactly a value pair in the values array and must be included in the select array
@param type $values
@param type $select
@param type $objectType
@param type $objectURI
@param type $objectId
Return Object lists with properties matching the given value