/**
  * @since 2.4
  *
  * @param string $property
  *
  * @return boolean
  */
 public function findPropertyListFor($property = '')
 {
     $this->meta = array();
     $this->propertyList = array();
     $this->namespaces = array();
     $this->requestOptions->limit++;
     // increase by one to look ahead
     $this->continueOffset = 1;
     if ($property !== '') {
         $property = str_replace("_", " ", $property);
         $this->requestOptions->addStringCondition($property, StringCondition::STRCOND_MID);
         // Disjunctive condition to allow for auto searches of foaf OR Foaf
         $this->requestOptions->addStringCondition(ucfirst($property), StringCondition::STRCOND_MID, true);
     }
     $propertyListLookup = $this->store->getPropertiesSpecial($this->requestOptions);
     $this->requestOptions->limit--;
     foreach ($propertyListLookup->fetchList() as $value) {
         if ($this->continueOffset > $this->requestOptions->limit) {
             break;
         }
         $this->addPropertyToList($value);
         $this->continueOffset++;
     }
     $this->continueOffset = $this->continueOffset > $this->requestOptions->limit ? $this->requestOptions->limit : 0;
     $this->namespaces = array_keys($this->namespaces);
     $this->meta = array('limit' => $this->requestOptions->limit, 'count' => count($this->propertyList), 'isCached' => $propertyListLookup->isCached());
     return true;
 }
 /**
  * @since 2.4
  *
  * @param string $property
  *
  * @return boolean
  */
 public function findPropertyListBy($property = '')
 {
     $requestOptions = new RequestOptions();
     $requestOptions->sort = true;
     $requestOptions->limit = $this->limit;
     $isFromCache = false;
     //
     $this->matchPropertiesToPreferredLabelBy($property);
     // Increase by one to look ahead
     $requestOptions->limit++;
     $requestOptions = $this->doModifyRequestOptionsWith($property, $requestOptions);
     $propertyListLookup = $this->store->getPropertiesSpecial($requestOptions);
     $isFromCache = $propertyListLookup->isFromCache();
     // Restore original limit
     $requestOptions->limit--;
     foreach ($propertyListLookup->fetchList() as $value) {
         if ($this->continueOffset > $requestOptions->limit) {
             break;
         }
         $this->addPropertyToList($value);
         $this->continueOffset++;
     }
     $this->continueOffset = $this->continueOffset > $requestOptions->limit ? $requestOptions->limit : 0;
     $this->namespaces = array_keys($this->namespaces);
     $this->meta = array('limit' => $requestOptions->limit, 'count' => count($this->propertyList), 'isCached' => $isFromCache);
     return true;
 }
예제 #3
0
 /**
  * @see Store::getPropertiesSpecial()
  * @since 1.8
  */
 public function getPropertiesSpecial($requestoptions = null)
 {
     return $this->baseStore->getPropertiesSpecial($requestoptions);
 }
예제 #4
0
 /**
  * Get the list of results.
  *
  * @param SMWRequestOptions $requestOptions
  * @return array of array( SMWDIProperty|SMWDIError, integer )
  */
 function getResults($requestOptions)
 {
     $this->collector = $this->store->getPropertiesSpecial($requestOptions);
     return $this->collector->getResults();
 }
 /**
  * Get the list of results.
  *
  * @param SMWRequestOptions $requestOptions
  * @return array of array( SMWDIProperty|SMWDIError, integer )
  */
 function getResults($requestOptions)
 {
     $this->listLookup = $this->store->getPropertiesSpecial($requestOptions);
     return $this->listLookup->fetchList();
 }