Cake\Chronos\ChronosInterval::__get PHP Method

__get() public method

Get a part of the ChronosInterval object
public __get ( string $name ) : integer
$name string The property to read.
return integer
    public function __get($name)
    {
        switch ($name) {
            case 'years':
                return $this->isHHVM ? parent::__get('y') : $this->y;
            case 'months':
                return $this->isHHVM ? parent::__get('m') : $this->m;
            case 'dayz':
                return $this->isHHVM ? parent::__get('d') : $this->d;
            case 'hours':
                return $this->isHHVM ? parent::__get('h') : $this->h;
            case 'minutes':
                return $this->isHHVM ? parent::__get('i') : $this->i;
            case 'seconds':
                return $this->isHHVM ? parent::__get('s') : $this->s;
            case 'weeks':
                return (int) floor(($this->isHHVM ? parent::__get('d') : $this->d) / ChronosInterface::DAYS_PER_WEEK);
            case 'daysExcludeWeeks':
            case 'dayzExcludeWeeks':
                return $this->dayz % ChronosInterface::DAYS_PER_WEEK;
            case 'days':
                return $this->isHHVM ? parent::__get('days') : $this->days;
            case 'y':
            case 'm':
            case 'd':
            case 'h':
            case 'i':
            case 's':
            case 'invert':
                return parent::__get($name);
            default:
                throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name));
        }
    }