public function __get($name)
{
switch ($name) {
case 'all':
return $this->_ids === self::ALL;
case 'ids':
return is_array($this->_ids) ? $this->_ids : array();
case 'largest':
return $this->_ids === self::LARGEST;
case 'max':
$this->sort();
return end($this->_ids);
case 'min':
$this->sort();
return reset($this->_ids);
case 'range_string':
if (!count($this)) {
return '';
}
$min = $this->min;
$max = $this->max;
return $min == $max ? $min : $min . ':' . $max;
case 'search_res':
return $this->_ids === self::SEARCH_RES;
case 'sequence':
return (bool) $this->_sequence;
case 'special':
return is_string($this->_ids);
case 'tostring':
case 'tostring_sort':
if ($this->all) {
return '1:*';
} elseif ($this->largest) {
return '*';
} elseif ($this->search_res) {
return '$';
}
return strval($this->_toSequenceString($name == 'tostring_sort'));
}
}