/** * @param array|string $searchFields Comma-separated list (or array) of database column names * that can be searched on. Used for generation of the database index defintions. */ public function __construct($searchFields = array()) { if (is_array($searchFields)) { $this->searchFields = '"' . implode('","', $searchFields) . '"'; } else { $this->searchFields = $searchFields; } parent::__construct(); }
/** * Construct a new Versioned object. * * @var string $mode One of "StagedVersioned" or "Versioned". */ public function __construct($mode = self::STAGEDVERSIONED) { parent::__construct(); // Handle deprecated behaviour if ($mode === 'Stage' && func_num_args() === 1) { Deprecation::notice("5.0", "Versioned now takes a mode as a single parameter"); $mode = static::VERSIONED; } elseif (is_array($mode) || func_num_args() > 1) { Deprecation::notice("5.0", "Versioned now takes a mode as a single parameter"); $mode = func_num_args() > 1 || count($mode) > 1 ? static::STAGEDVERSIONED : static::VERSIONED; } if (!in_array($mode, array(static::STAGEDVERSIONED, static::VERSIONED))) { throw new InvalidArgumentException("Invalid mode: {$mode}"); } $this->mode = $mode; }