protected function setKey($type, $key) { if (!in_array(null, $this->tables)) { Validate::table($this->tables[$type])->field($key); $this->keys[$type] = $key; return $this; } throw new LazerException('First you must define tables name'); }