Delete 1 or many entities, using their Keys

Consumes Schema

@todo Determine success. Not 100% how to do this from the response yet.

@param array $arr_entities
@return bool
964482
public function deleteMulti(array $arr_entities)
    {
        $obj_mapper = $this->createMapper();
        $obj_request = $this->setupCommit();
        $obj_mutation = $obj_request->mutableDeprecatedMutation();
        foreach($arr_entities as $obj_gds_entity) {
            $this->applyNamespace(
                $obj_mapper->configureGoogleKey(
                    $obj_mutation->addDelete(), $obj_gds_entity
                )
            );
        }
        $this->execute('Commit', $obj_request, new CommitResponse());
        $this->obj_schema = null;
        return TRUE; // really?
    }
24434
public function delete()
    {
        // Validate form
        $form = $this->getForm('Delete' . $this->getEntityName());
        if (!$form->isValid()) {
            $this->addMessage($form->getMessages(), FlashMessenger::NAMESPACE_ERROR);
            return false;
        }

        // Remove account entity
        $entity = $form->getData();
        $this->getEntityManager()->remove($entity);

        // Trigger ondelete
        $this->onDelete($entity);

        // Save
        return $this->save($this->getEntityName() . ' deleted.', 'Unable to delete ' . strtolower($this->getEntityName()) . '.');
    }
59819
public function delete($instance)
    {
        $collection = $instance instanceof Document ? [$instance] : $instance;

        $key = $this->key();
        if (!$key) {
          throw new ORMException("No primary key has been defined for `" + instance.self() + "`'s schema.");
        }

        $keys = [];

        foreach ($collection as $entity) {
            $entity->sync();
            if ($entity->exists()) {
                $keys[] = $entity->id();
            }
        }

        if (!$keys) {
            return true;
        }

        if (!$this->remove([$key => (count($keys) ===1 ? $keys[0] : $keys)])) {
            return false;
        }

        foreach ($collection as $entity) {
            $entity->amend([], ['exists' => false]);
        }

        return true;
    }
1073670
public function delete_many(array $keys) {
        // Redis needs the hash as the first argument, so we have to put it at the start of the array.
        array_unshift($keys, $this->hash);
        return call_user_func_array(array($this->redis, 'hDel'), $keys);
    }
1280302
public static function is_multi($arr, $allKeys = false)
    {
        $values = array_filter($arr, 'is_array');
        return $allKeys ? count($arr) === count($values) : count($values) > 0;
    }
614110
public static function arrayRemove($arr, $key, $default = null)
    {
        if (isset($arr[$key])) {
            $value = $arr[$key];
            unset($arr[$key]);

            return $value;
        }

        return $default;
    }
1164167
public static function isValidArray($arr)
    {
        if (!is_array($arr) || empty($arr) || count($arr) < 1) {
            return false;
        }

        return true;
    }
1311553
public function delete(array $data, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    foreach ($data as $key => $id)
    {
      $JournalEntry = $this->byId($id, $databaseConnectionName);
      $JournalEntry->delete();
    }
    // $this->Account->destroy($data);

    return true;
  }
712289
protected function doSet(Array $arr)
    {
        foreach ($arr as $name => $data) {
            $this->save($name, $data);
        }

        return true;
    }
121514
public static function remove_empty($arr)
    {
        if (empty($arr)) {
            return null;
        }
        foreach ($arr as $key => $value) {
            if (is_array($value)) {
                $arr[$key] = self::remove_empty($value);
            } else {
                if (empty($value)) {
                    unset($arr[$key]);
                } else {
                    $arr[$key] = $value;
                }
            }
        }
        return $arr;
    }
62523
protected static function deleteMultiple(array &$arr, array $keys)
    {
        $return = [];
        foreach ($keys as $key) {
            $return[$key] = static::delete($arr, $key);
        }

        return $return;
    }
329481
public static function delete( $key, &$arr ) 
	{	
		if ( isset( $arr[$key] ) ) 
		{
			unset( $arr[$key] ); return;
		}

		if ( strpos( $key, '.' ) !== false ) 
		{	
			$kp = explode( '.', $key );

			switch ( count( $kp ) ) {
				case 2:
					unset( $arr[$kp[0]][$kp[1]] ); return; break;
				case 3:
					unset( $arr[$kp[0]][$kp[1]][$kp[2]] ); return; break;
				case 4:
					unset( $arr[$kp[0]][$kp[1]][$kp[2]][$kp[3]] ); return; break;
			}
		}
	}
478894
protected function deleteEntity($entity)
    {
        $this->checkEntityType($entity);

        $delete = new Delete($this->aggregate($entity), $this->newQueryBuilder());

        $delete->execute();
    }
739238
public function cascadeDelete(EntityInterface $entity, array $options = [])
    {
        if (!$this->getDependent()) {
            return true;
        }
        $foreignKey = (array)$this->getForeignKey();
        $bindingKey = (array)$this->getBindingKey();
        $conditions = [];

        if (!empty($bindingKey)) {
            $conditions = array_combine($foreignKey, $entity->extract($bindingKey));
        }

        $table = $this->junction();
        $hasMany = $this->getSource()->getAssociation($table->getAlias());
        if ($this->_cascadeCallbacks) {
            foreach ($hasMany->find('all')->where($conditions)->all()->toList() as $related) {
                $table->delete($related, $options);
            }

            return true;
        }

        $conditions = array_merge($conditions, $hasMany->getConditions());

        $table->deleteAll($conditions);

        return true;
    }
680972
public function delete_many(array $keys) {
        if ($this->clustered) {
            // Get the minimum deleted from any of the connections.
            $count = count($keys);
            foreach ($this->setconnections as $connection) {
                $count = min($this->delete_many_connection($connection, $keys), $count);
            }
            return $count;
        }

        return $this->delete_many_connection($this->connection, $keys);
    }
1323712
public static function remove(&$arr, $key, $default = null)
    {
        if (isset($arr[$key])) {
            $value = $arr[$key];
            unset($arr[$key]);
        } else {
            $value = $default;
        }

        return $value;
    }
1085790
public function deleteMultiple($keys): bool
    {
        if (
            !\is_array($keys)
            &&
            !($keys instanceof \Traversable)
        ) {
            throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true));
        }

        $results = [];
        foreach ((array) $keys as $key) {
            $results[] = $this->delete($key);
        }

        return !\in_array(false, $results, true);
    }