public function relations($tableName = null, $assoc = false)
    {
        if (is_array($tableName))
        {
            $relations = $this->getKey('relations', $assoc);
            if ($assoc)
            {
                return array_intersect_key($relations, array_flip($tableName));
            }
            else
            {
                return (object) array_intersect_key((array) $relations, array_flip($tableName));
            }
        }
        elseif ($tableName !== null)
        {
            return $assoc ? $this->getKey('relations', $assoc)[$tableName] : $this->getKey('relations', $assoc)->{$tableName};
        }

        return $this->getKey('relations', $assoc);
    }
public function relations($tableName = null, $assoc = false)
    {
        if (is_array($tableName))
        {
            $relations = $this->getKey('relations', $assoc);
            if ($assoc)
            {
                return array_intersect_key($relations, array_flip($tableName));
            }
            else
            {
                return (object) array_intersect_key((array) $relations, array_flip($tableName));
            }
        }
        elseif ($tableName !== null)
        {
            return $assoc ? $this->getKey('relations', $assoc)[$tableName] : $this->getKey('relations', $assoc)->{$tableName};
        }

        return $this->getKey('relations', $assoc);
    }
public function relations ( $ tableName = null , $ assoc = false ) { if ( is_array ( $ tableName ) ) { $ relations = $ this -> getKey ( 'relations' , $ assoc ) ; if ( $ assoc ) { return array_intersect_key ( $ relations , array_flip ( $ tableName ) ) ; } else { return ( object ) array_intersect_key ( ( array ) $ relations , array_flip ( $ tableName ) ) ; } } elseif ( $ tableName !== null ) { return $ assoc ? $ this -> getKey ( 'relations' , $ assoc ) [ $ tableName ] : $ this -> getKey ( 'relations' , $ assoc ) -> { $ tableName } ; } return $ this -> getKey ( 'relations' , $ assoc ) ; }
Return relations configure
@param mixed $tableName null-all tables;array-few tables;string-one table relation informations
@param boolean $assoc Object or associative array
@return array|object
Return relations configure