lithium\data\Model::_inherit PHP Method

_inherit() protected method

Merge parent class attributes to the current instance.
protected _inherit ( )
    protected function _inherit()
    {
        $inherited = array_fill_keys($this->_inherited(), array());
        foreach (static::_parents() as $parent) {
            $parentConfig = get_class_vars($parent);
            foreach ($inherited as $key => $value) {
                if (isset($parentConfig["{$key}"])) {
                    $val = $parentConfig["{$key}"];
                    if (is_array($val)) {
                        $inherited[$key] += $val;
                    }
                }
            }
            if ($parent === __CLASS__) {
                break;
            }
        }
        foreach ($inherited as $key => $value) {
            if (is_array($this->{$key})) {
                $this->{$key} += $value;
            }
        }
    }