/** * Set index field * * @param string|array $field String (ex: -title | title) or array (ex: ['title' => -1]) * * @throws \Webiny\Component\Mongo\MongoException * @return $this */ public function setFields($field) { if ($this->isString($field)) { $field = [$field]; } if ($this->isArray($field) && count($field) != 1) { throw new MongoException(MongoException::SINGLE_INDEX_TOO_MANY_FIELDS, [count($field)]); } return parent::setFields($field); }
public function getOptions() { $options = parent::getOptions(); $options['default_language'] = $this->language; return $options; }