protected final function hasMany($tableCls, $foreign_key = '', $value_key = '') {
        if (!$tableCls instanceof View) {
            $tableCls = new SimpleTable($tableCls, $this->dbconnection);
        }
        if (!$foreign_key) {
            $foreign_key = $this->foreignKey;
        }

        if (!$value_key) {
            $value_key = $this->primaryKey;
        }

        $sql = $tableCls->select();

        return [$sql, $foreign_key, $value_key, false, 'hasMany'];
    }
protected final function hasMany($tableCls, $foreign_key = '', $value_key = '') {
        if (!$tableCls instanceof View) {
            $tableCls = new SimpleTable($tableCls, $this->dbconnection);
        }
        if (!$foreign_key) {
            $foreign_key = $this->foreignKey;
        }

        if (!$value_key) {
            $value_key = $this->primaryKey;
        }

        $sql = $tableCls->select();

        return [$sql, $foreign_key, $value_key, false, 'hasMany'];
    }
protected final function hasMany ( $ tableCls , $ foreign_key = '' , $ value_key = '' ) { if ( ! $ tableCls instanceof View ) { $ tableCls = new SimpleTable ( $ tableCls , $ this -> dbconnection ) ; } if ( ! $ foreign_key ) { $ foreign_key = $ this -> foreignKey ; } if ( ! $ value_key ) { $ value_key = $ this -> primaryKey ; } $ sql = $ tableCls -> select ( ) ; return [ $ sql , $ foreign_key , $ value_key , false , 'hasMany' ] ; }
one-to-many.

@param View|string $tableCls
@param string      $foreign_key 值字段在$tableCls中的引用.
@param string      $value_key   值字段，默认为本表主键.

@return array
one - to - many .