When $each is true, each record gets it's delete() method called.
Otherwise, a delete query is built for the entire collection

@param bool $each
@return $this
168310
public function delete($each = false)
    {
        if (count($this) > 0) {
            if ($each) {
                foreach ($this as $item) {
                    $item->delete();
                }
            } else {
                $primaryKey = $this->getManager()->getPrimaryKey();
                $pk_list = HelperBroker::get('Arrays')->pluck($this, $primaryKey);

                $query = $this->getManager()->newQuery("delete");
                $query->where("$primaryKey IN ?", $pk_list);
                $query->execute();
            }

            $this->clear();
        }

        return $this;
    }
1229719
def each(&block)
      collection.each do |id, url|
        object = cached(id) { klass.from_url(url, prefix) }
        block.call(object) if block
      end
    end
978602
public function each(callable $callback)
    {
        foreach ($this->collection as $key => $value) {
            $callback($value, $key);
        }
    }
109328
public function remove($attrs)
    {
        !is_array($attrs) && $attrs = array('id' => $attrs);
        
        foreach ($this->members() as $k => $m) {
            foreach ($attrs as $a => $v) {
                if ($m->getAttribute($a) != $v)
                    continue 2;
            }
            unset($this->members[$k]);
        }
        $this->members = array_values($this->members);
        return $this;
    }
584858
public function commit($pWithChilds = false)
    {
        try {
            $prepared = Agl::app()->getDb()->getConnection()->prepare("
                DELETE
                FROM
                    `" . $this->getDbPrefix() . $this->_item->getDbContainer() . "`
                WHERE
                    `" . $this->_item->getDbContainer() . ItemInterface::PREFIX_SEPARATOR . ItemInterface::IDFIELD . "` = :" . ItemInterface::IDFIELD . "
            ");

            $preparedValues = array(
                ItemInterface::IDFIELD => $this->_item->getId()->getOrig()
            );

            if (! $prepared->execute($preparedValues)) {
                $error = $prepared->errorInfo();
                throw new Exception("The delete query failed (table '" . $this->getDbPrefix() . $this->_item->getDbContainer() . "') with message '" . $error[2] . "'");
            }

            if ($pWithChilds) {
                $this->_item->removeJoinFromAllChilds();
            }

            if (Agl::app()->isDebugMode()) {
                Agl::app()->getDb()->incrementCounter();
            }

            return $prepared->rowCount();
        } catch (Exception $e) {
            throw new Exception($e);
        }

        return true;
    }
1230290
public function delete()
    {
        if (isset($this->onDelete)) {
            return call_user_func($this->onDelete, $this);
        }

        return $this->toBase()->delete();
    }
660278
public function each($callback)
    {
        array_walk($this->array, function($value, $key) use ($callback) {
            $callback($key, $value);
        });

        return $this;
    }
904837
public function delete($id)
    {
        $model = $this->findRecord($id);

        if ($model) {
            return $model->delete();
        }

        return false;

    }
916209
public function union($query, $all = false)
    {
        if ($query instanceof Closure) {
            call_user_func($query, $query = $this->newQuery());
        }

        $this->unions[] = compact('query', 'all');

        $this->addBinding($query->getBindings(), 'union');

        return $this;
    }
815942
public function delete($where): Statement
    {
        $this->operation = 'delete';
        if ($where) {
            $this->where = $where;
        }
        return $this;
    }
850921
function each(callable $closure) {
        foreach($this->data as $key => $val) {
            $feed = $closure($val, $key);
            if($feed === false) {
                break;
            }
        }
        
        return $this;
    }
43057
public function delete() {
		if ($this->dbId()) {
			$this->db()->query('DELETE FROM `'.$this->table().'` WHERE `'.$this->idVar().'` = ?', [$this->dbId()]);
		} else {
			throw new Exception('Cannot delete. No ID was given.');
		}
		return $this;
	}
208808
public function delete($table = false)
    {
        if ($table === false) {
            $this->delete = true;
        } else {
            // Reset the array in case the class variable was previously set to a
            // boolean value.
            if (!is_array($this->delete)) {
                $this->delete = array();
            }

            $this->delete[] = $table;
        }

        return $this;
    }
751931
public function each(callable $callback)
    {
        foreach ($this->items as $key => $item) {
            $result = $callback($item, $key);

            if (false === $result) {
                break;
            }

            if (!is_object($item)) {
                $this->items[$key] = $result;
            }
        }

        return $this;
    }
1171602
public function delete()
    {
        if (!$this->isNew()) {
            $this->_collection->remove(['_id' => $this->_id]);
            $this->_cache->delete(static::getCollection()."_{$this->_id}");
            return true;
        }
        return false;
    }
936777
public function delete ($where) 
    {
        parent::delete($where);
        Helper::mapMethod($this->_records, 'delete', array($where));
    }
712786
public function each($callback)
    {
        Argument::i()->test(1, 'callable');

        foreach ($this->list as $key => $value) {
            call_user_func($callback, $key, $value);
        }

        return $this;
    }