public function chain($object) { if (!is_object($object)) { throw new BaseException('Specify $this as argument if you call chain()'); } return $object->add($this->chain_class); }