public function with(array $related)
    {

        $relations = $this->getEntityObject()->getRelations();
        foreach ($relations as $fk => $target) {
            $table = strstr($target, '.', true);

            if (in_array($table, $related)) {

                $this->sql(" ,$table.*");
                $this->join($table, "$this->oosql_table.$fk = $target");
            } elseif (isset($related[$table])) {

                foreach ($related[$table] as $field) {
                    $this->sql(" ,$table.$field");
                }
                $this->join($table, "$this->oosql_table.$fk = $target");
            }
        }
        return $this;
    }
public function with(array $related)
    {

        $relations = $this->getEntityObject()->getRelations();
        foreach ($relations as $fk => $target) {
            $table = strstr($target, '.', true);

            if (in_array($table, $related)) {

                $this->sql(" ,$table.*");
                $this->join($table, "$this->oosql_table.$fk = $target");
            } elseif (isset($related[$table])) {

                foreach ($related[$table] as $field) {
                    $this->sql(" ,$table.$field");
                }
                $this->join($table, "$this->oosql_table.$fk = $target");
            }
        }
        return $this;
    }
public function with ( array $ related ) { $ relations = $ this -> getEntityObject ( ) -> getRelations ( ) ; foreach ( $ relations as $ fk => $ target ) { $ table = strstr ( $ target , '.' , true ) ; if ( in_array ( $ table , $ related ) ) { $ this -> sql ( " ,$table.*" ) ; $ this -> join ( $ table , "$this->oosql_table.$fk = $target" ) ; } elseif ( isset ( $ related [ $ table ] ) ) { foreach ( $ related [ $ table ] as $ field ) { $ this -> sql ( " ,$table.$field" ) ; } $ this -> join ( $ table , "$this->oosql_table.$fk = $target" ) ; } } return $ this ; }
Creates a join automatically based on the relationships of current entity
@param array $related
@return \Phiber\oosql\oosql
Creates a join automatically based on the relationships of current entity