/** * Use the remove query to remove all items from the collection * @param Jam_Validated $model * @param Jam_Array_Association $collection */ public function clear(Jam_Validated $model, Jam_Array_Association $collection) { if ($ids = array_filter($collection->ids())) { $query = $this->remove_items_query($model, $ids); if ($query) { $query->execute(Jam::meta($this->model)->db()); } } }
public function test_null_content() { $association_array = Jam_Array_Association::factory(); $association_array->model('test_blog'); $this->assertSame(array(), $association_array->as_array()); }