/** * Use relation to table * @param string $table Table name * @return \Lazer\Classes\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; }
/** * @covers Lazer\Classes\Helpers\Validate::relation * @expectedException Lazer\Classes\LazerException */ public function testRelationNotExists() { $this->object->relation('users', 'tags'); }