/** * Create a new instance of self in most cases * you could actually replace this with any * class you choose, it would just have to * implement the `get()` method. * * @param $method * * @return $this|mixed */ public function createNewInstance($method) { return DocumentFactory::create($this->corpus, $this->config, $this->name, $method); }
/** * @param $name * * @return $this */ public function createDocument($name) { $config = new Config($this->config->getBaseUri(), $this->config->getUsername(), $this->config->getPassword()); $this->documents[$name] = DocumentFactory::create($this, $config, $name); return $this; }