Phalcon\Db\Adapter\MongoDB\Operation\Delete::__construct PHP Метод

__construct() публичный Метод

Supported options: * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
public __construct ( string $databaseName, string $collectionName, array | object $filter, integer $limit, array $options = [] )
$databaseName string Database name
$collectionName string Collection name
$filter array | object Query by which to delete documents
$limit integer The number of matching documents to delete. Must be 0 or 1, for all or a single document, respectively.
$options array Command options
    public function __construct($databaseName, $collectionName, $filter, $limit, array $options = [])
    {
        if (!is_array($filter) && !is_object($filter)) {
            throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object');
        }
        if ($limit !== 0 && $limit !== 1) {
            throw new InvalidArgumentException('$limit must be 0 or 1');
        }
        if (isset($options['writeConcern']) && !$options['writeConcern'] instanceof WriteConcern) {
            throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\\Driver\\WriteConcern');
        }
        $this->databaseName = (string) $databaseName;
        $this->collectionName = (string) $collectionName;
        $this->filter = $filter;
        $this->limit = $limit;
        $this->options = $options;
    }