src/Database/Model/Relatable.php
public static function getRelationInfo($name, $info = array())
    {
        // Get current models namespace
        $class = new \ReflectionClass(get_called_class());
        $namespace = $class->getNamespaceName();

        // Name
        $info['name'] = $name;

        // Model and class
        if (!isset($info['model'])) {
            // Model
            $info['model'] = Inflector::modelise($name);
        }

        // Set model namespace
        if (strpos($info['model'], '\\') === false) {
            $info['model'] = "\\{$namespace}\\{$info['model']}";
        }

        // Class
        $model = new \ReflectionClass($info['model']);
        $info['class'] = $model->getShortName();

        return $info;
    }
public static function getRelationInfo($name, $info = array())
    {
        // Get current models namespace
        $class = new \ReflectionClass(get_called_class());
        $namespace = $class->getNamespaceName();

        // Name
        $info['name'] = $name;

        // Model and class
        if (!isset($info['model'])) {
            // Model
            $info['model'] = Inflector::modelise($name);
        }

        // Set model namespace
        if (strpos($info['model'], '\\') === false) {
            $info['model'] = "\\{$namespace}\\{$info['model']}";
        }

        // Class
        $model = new \ReflectionClass($info['model']);
        $info['class'] = $model->getShortName();

        return $info;
    }
public static function getRelationInfo ( $ name , $ info = array ( ) ) { // Get current models namespace $ class = new \ ReflectionClass ( get_called_class ( ) ) ; $ namespace = $ class -> getNamespaceName ( ) ; // Name $ info [ 'name' ] = $ name ; // Model and class if ( ! isset ( $ info [ 'model' ] ) ) { // Model $ info [ 'model' ] = Inflector :: modelise ( $ name ) ; } // Set model namespace if ( strpos ( $ info [ 'model' ] , '\\' ) === false ) { $ info [ 'model' ] = "\\{$namespace}\\{$info['model']}" ; } // Class $ model = new \ ReflectionClass ( $ info [ 'model' ] ) ; $ info [ 'class' ] = $ model -> getShortName ( ) ; return $ info ; }
Returns an array containing information about the
relation.

@param string $name Relation name
@param array  $info Relation info

@return array
Returns an array containing information about the relation .