private function getPreferredLocalizedSeparator($custom, $standard, $language)
 {
     if ($this->options->has($custom) && ($separator = $this->options->get($custom)) !== false) {
         return $separator;
     }
     return Message::get($standard, Message::TEXT, $language);
 }
 public function testAddOption()
 {
     $instance = new Options();
     $this->assertFalse($instance->has('Foo'));
     $instance->set('Foo', 42);
     $this->assertEquals(42, $instance->get('Foo'));
 }
 /**
  * @since 2.4
  *
  * @param string $key
  *
  * @return mixed|false
  */
 public function getOptionBy($key)
 {
     if ($this->options !== null && $this->options->has($key)) {
         return $this->options->get($key);
     }
     return false;
 }
 private function getPagesFromQuery()
 {
     if (!$this->options->has('query')) {
         return array();
     }
     $queryString = $this->options->get('query');
     // get number of pages and fix query limit
     $query = SMWQueryProcessor::createQuery($queryString, SMWQueryProcessor::getProcessedParams(array('format' => 'count')));
     $result = $this->store->getQueryResult($query);
     // get pages and add them to the pages explicitly listed in the 'page' parameter
     $query = SMWQueryProcessor::createQuery($queryString, SMWQueryProcessor::getProcessedParams(array()));
     $query->setUnboundLimit($result instanceof \SMWQueryResult ? $result->getCountValue() : $result);
     return $this->store->getQueryResult($query)->getResults();
 }
 /**
  * @param array $options
  */
 private function setFiltersFromOptions(Options $options)
 {
     $this->filters = array();
     if ($options->has('categories')) {
         $this->filters[] = NS_CATEGORY;
     }
     if ($options->has('p')) {
         $this->filters[] = SMW_NS_PROPERTY;
     }
 }