lithium\data\Model::remove PHP Méthode

remove() public static méthode

Remove multiple documents or records based on a given set of criteria. **WARNING**: If no criteria are specified, or if the criteria ($conditions) is an empty value (i.e. an empty array or null), all the data in the backend data source (i.e. table or collection) _will_ be deleted.
public static remove ( mixed $conditions = [], array $options = [] ) : boolean
$conditions mixed An array of key/value pairs representing the scope of the records or documents to be deleted.
$options array Any database-specific options to use when performing the operation. See the `delete()` method of the corresponding backend database for available options.
Résultat boolean Returns `true` if the remove operation succeeded, otherwise `false`.
    public static function remove($conditions = array(), array $options = array())
    {
        $params = compact('conditions', 'options');
        return static::_filter(__FUNCTION__, $params, function ($self, $params) {
            $options = $params['options'] + $params + array('model' => $self, 'type' => 'delete');
            unset($options['options']);
            $query = $self::invokeMethod('_instance', array('query', $options));
            return $self::connection()->delete($query, $options);
        });
    }