MassDeleteCommand Class Reference
[Behaviour]
Executes a mass delete. More...
Inheritance diagram for
MassDeleteCommand:
Protected Member Functions |
|
do_execute () | |
Executes commands. |
Detailed Description
Executes a mass delete.
- Instance must be a type string
- Params are set as "WHERE $field = $value" when key values pairs
- IF params are DBWhereObject they get added directly
Definition at line 12 of file massdelete.cmd.php.
Member Function Documentation
MassDeleteCommand::do_execute | ( | ) | [protected] |
Executes commands.
- Returns:
- Status
Reimplemented from CommandTransactional.
Definition at line 18 of file massdelete.cmd.php.
00018 { 00019 $ret = new Status(); 00020 $o = DB::create($this->get_instance()); 00021 if ($o) { 00022 foreach(Arr::force($this->get_params(), false) as $key => $value) { 00023 if ($value instanceof IDBWhere) { 00024 $o->add_where_object($value); 00025 } 00026 else if ($value instanceof DBCondition) { 00027 $o->add_where($value->column, $value->operator, $value->value); 00028 } 00029 else if (is_int($key)) { 00030 $o->add_where($value); 00031 } 00032 else { 00033 $o->add_where($key, '=', $value); 00034 } 00035 } 00036 $ret->merge($o->delete(DataObjectBase::WHERE_ONLY)); 00037 } 00038 else { 00039 $ret->append(tr('Delete Command: No valid instance type set', 'core')); 00040 } 00041 return $ret; 00042 }
The documentation for this class was generated from the following file:
- gyro/core/behaviour/commands/generics/massdelete.cmd.php