Contao\Database\Result::__get PHP Method

__get() public method

Return an object property or a field of the current row
public __get ( string $strKey ) : mixed | null
$strKey string The field name
return mixed | null The field value or null
    public function __get($strKey)
    {
        switch ($strKey) {
            case 'query':
                return $this->strQuery;
                break;
            case 'numRows':
                return $this->count();
                break;
            case 'numFields':
                return $this->resResult->columnCount();
                break;
            case 'isModified':
                return $this->blnModified;
                break;
            default:
                if (empty($this->arrCache)) {
                    $this->next();
                }
                if (isset($this->arrCache[$strKey])) {
                    return $this->arrCache[$strKey];
                }
                break;
        }
        return null;
    }

Usage Example

コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function __get($strKey)
 {
     return $this->result->__get($strKey);
 }