Lazer\Classes\Core_Relation::with PHP 메소드

with() 공개 메소드

Use relation to table
public with ( string $table ) : Core_Relation
$table string Table name
리턴 Core_Relation
    public function with($table)
    {
        Validate::relation($this->tables['local'], $table);
        $this->setTable('foreign', $table);
        $this->setRelationType(Config::table($this->tables['local'])->relations($this->tables['foreign'])->type);
        $this->setKey('local', Config::table($this->tables['local'])->relations($this->tables['foreign'])->keys->local);
        $this->setKey('foreign', Config::table($this->tables['local'])->relations($this->tables['foreign'])->keys->foreign);
        return $this;
    }