Delete
Delete an existing list item.

@param String $list_name Name of list
@param int $ID ID of item to delete
@param array $data An array of additional required key/value pairs for the item to delete e.g. FileRef => URL to file.
@return Array
161936
public function delete ($list_name, $ID, array $data = array()) {
		return $this->deleteMultiple($list_name, array($ID), array($ID => $data));
	}
1342106
public function delete($collectionName, $id)
    {

        $response = $this->doRequest('DELETE', 'collections/' . $collectionName . '/' . $id . '/');
        $body = $response->getBody()->getContents();
        return json_decode($body, true);
    }
968245
def DeleteList(self, listName):
        """"""

        # Build Request
        soap_request = soap('DeleteList')
        soap_request.add_parameter('listName', listName)
        self.last_request = str(soap_request)

        # Send Request
        response = self._session.post(url=self._url('Lists'),
                                      headers=self._headers('DeleteList'),
                                      data=str(soap_request),
                                      verify=self._verify_ssl,
                                      timeout=self.timeout)

        # Parse Request
        if response == 200:
            return response.text
        else:
            return response
882330
public function deleteFromList($key_array = array())
    {

        if (empty($key_array)) return false;

        foreach ($key_array as $key_del) {
            if (empty($this->cacheListing)) break;
            foreach ($this->cacheListing as $key) {
                if (mb_strpos(mb_strtolower($key), mb_strtolower($key_del)) !== false) $this->delete($key);
            }
        }

        return true;
    }
193214
public function setList($id, $listId)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/idList', array('value' => $listId));
    }
668715
protected function __apiForceDelete (array $list)
    {
        HCGroupsUsers::whereIn ('group_id', $list)->forceDelete ();
        HCGroups::onlyTrashed ()->whereIn ('id', $list)->forceDelete ();

        return hcSuccess ();
    }
287030
def delete_user_contact_lists_contacts(self, id, contact_list_id, **data):
        
        
        return self.delete("/users/{0}/contact_lists/{0}/contacts/".format(id,contact_list_id), data=data)
72155
public function delete($listUuid)
    {
        $list = $this->findListByUuid($listUuid);

        foreach (array_keys($list) as $elementUuid) {
            $this->deleteElement($listUuid, $elementUuid);
        }
    }
1044763
public static function delete($id = null, $type = null, $specific = null) {

		$path = preg_match('/public/i', $id)?explode('public/', $id)[1]:$id;
		if ($type === null && $id !== null and !is_numeric($id)) {
			if (Storage::disk(env('FILESYSTEM_DRIVER', 'public'))->has($path)) {
				Storage::delete($id);
			}
		} elseif ($specific !== null && $specific > 0) {
			$delete = Files::find($specific);
			if (!empty($delete)) {
				foreach (self::sizes() as $key => $val) {
					if (Storage::disk(env('FILESYSTEM_DRIVER', 'public'))->has($path)) {
						Storage::delete($delete->path.$key.'_'.$delete->file);
						Storage::deleteDirectory($delete->path);
					}
				}
				Storage::delete($delete->full_path);
				Storage::deleteDirectory($delete->path);
				$delete->forceDelete();
			}
		} elseif (!empty($type) and !empty($id) && empty($specific)) {
			$delete_all = Files::where('type_file', $type)->where('type_id', $id)->get();
			foreach ($delete_all as $delete) {
				foreach (self::sizes() as $key => $val) {
					if (Storage::has($delete->path.'/'.$val.'_'.$delete->file)) {
						Storage::delete($delete->path.'/'.$val.'_'.$delete->file);
					}
				}
				Storage::delete($delete->full_path);
				Storage::deleteDirectory($delete->path);
				Storage::deleteDirectory($type.'/'.$id);
				$delete->forceDelete();
			}
		}
	}
1339034
public function delete($file_id)
    {
        if (empty($file_id)) {
            return false;
        }

        $deleted = $count = 0;
        foreach ((array) $this->file->getList(array('file_id' => $file_id)) as $file) {
            $deleted += (int) $this->file->delete($file['file_id']);
            $count++;
        }

        return $count && $count == $deleted;
    }
810133
public function write(string $id, array $data) : bool
    {
        static $create, $update, $delete;
        $values = $data + compact('id'); // Default.
        unset($values['dateactive']);
        if (!isset($create, $update)) {
            $fields = [];
            $placeholders = [];
            $updates = [];
            foreach ($values as $key => &$value) {
                if ($key == 'data') {
                    $value = base64_encode($value);
                }
                $fields[] = $key;
                $placeholders[] = ":$key";
                if ($key != 'id') {
                    $updates[] = "$key = :$key";
                }
            }
            $create = $this->pdo->prepare(sprintf(
                "INSERT INTO cesession_session (%s) VALUES (%s)",
                implode(', ', $fields),
                implode(', ', $placeholders)
            ));
            $update = $this->pdo->prepare(sprintf(
                "UPDATE cesession_session SET %s WHERE id = :id",
                implode(', ', $updates)
            ));
            $delete = $this->pdo->prepare("DELETE FROM cesession_session WHERE id = :id");
        }
        if ($this->exists) {
            $update->execute($values);
            return (bool)$update->rowCount();
        } else {
            $delete->execute(compact('id'));
            try {
                $create->execute($values);
                return ($affectedRows = $create->rowCount()) && $affectedRows;
            } catch (PDOException $e) {
                $update->execute($values);
                return (bool)$update->rowCount();
            }
        }
    }
613494
public function datalist( $id, $list = [] ) {
		$this->type = 'datalist';

		$attributes['id'] = $id;

		$html = [];

		if ( $this->is_associative_array( $list ) ) {
			foreach ( $list as $value => $display ) {
				$html[] = $this->option( $display, $value, null, [] );
			}
		} else {
			foreach ( $list as $value ) {
				$html[] = $this->option( $value, $value, null, [] );
			}
		}

		$attributes = $this->attributes( $attributes );

		$list = implode( '', $html );

		return $this->to_html_string( "<datalist{$attributes}>{$list}</datalist>" );
	}
212305
public function getListById($list_id)
		{
			$form_data = array(
				'list_id' => $list_id
			);
			$xml = $this->call('getlistbyid', $form_data);

			$list = new MailingList;
			$list
				->setListId((int)$xml->list_id)
				->setListName((string)$xml->list_name)
				->setDescription((string)$xml->description)
				->setTemplate((string)$xml->template)
				->setFromAddress((string)$xml->from)
				->setReplyToAddress((string)$xml->reply_to)
				->setBounceAddress((string)$xml->errors_to)
				->setTrackClicks((bool)$xml->track_clicks)
				->setTrackOpens((bool)$xml->track_opens)
				->setFolderId((int)$xml->folder_Id);

			return $list;
		}
855734
public function update ($item_id, array $data) {
		return $this->api->update($this->list_name, $item_id, $data);
	}
688432
public function delete_attachment( $_ID ) {

		global $wpdb;

		$_ID = (int) $_ID;

		do_action( 'pods_delete_attachment', $_ID );

		$file_types = "'" . implode( "', '", PodsForm::file_field_types() ) . "'";

		if ( ! pods_tableless() ) {
			$sql = "
                DELETE `rel`
                FROM `@wp_podsrel` AS `rel`
                LEFT JOIN `{$wpdb->posts}` AS `p`
                    ON
                        `p`.`post_type` = '_pods_field'
                        AND ( `p`.`ID` = `rel`.`field_id` OR `p`.`ID` = `rel`.`related_field_id` )
                LEFT JOIN `{$wpdb->postmeta}` AS `pm`
                    ON
                        `pm`.`post_id` = `p`.`ID`
                        AND `pm`.`meta_key` = 'type'
                        AND `pm`.`meta_value` IN ( {$file_types} )
                WHERE
                    `p`.`ID` IS NOT NULL
                    AND `pm`.`meta_id` IS NOT NULL
                    AND `rel`.`item_id` = {$_ID}";

			pods_query( $sql, false );
		}

		// Post Meta
		if ( ! empty( PodsMeta::$post_types ) ) {
			$sql = "
                DELETE `rel`
                FROM `@wp_postmeta` AS `rel`
                LEFT JOIN `{$wpdb->posts}` AS `p`
                    ON
                        `p`.`post_type` = '_pods_field'
                LEFT JOIN `{$wpdb->postmeta}` AS `pm`
                    ON
                        `pm`.`post_id` = `p`.`ID`
                        AND `pm`.`meta_key` = 'type'
                        AND `pm`.`meta_value` IN ( {$file_types} )
                WHERE
                    `p`.`ID` IS NOT NULL
                    AND `pm`.`meta_id` IS NOT NULL
                    AND `rel`.`meta_key` = `p`.`post_name`
                    AND `rel`.`meta_value` = '{$_ID}'";

			pods_query( $sql, false );
		}

		// User Meta
		if ( ! empty( PodsMeta::$user ) ) {
			$sql = "
                DELETE `rel`
                FROM `@wp_usermeta` AS `rel`
                LEFT JOIN `{$wpdb->posts}` AS `p`
                    ON
                        `p`.`post_type` = '_pods_field'
                LEFT JOIN `{$wpdb->postmeta}` AS `pm`
                    ON
                        `pm`.`post_id` = `p`.`ID`
                        AND `pm`.`meta_key` = 'type'
                        AND `pm`.`meta_value` IN ( {$file_types} )
                WHERE
                    `p`.`ID` IS NOT NULL
                    AND `pm`.`meta_id` IS NOT NULL
                    AND `rel`.`meta_key` = `p`.`post_name`
                    AND `rel`.`meta_value` = '{$_ID}'";

			pods_query( $sql, false );
		}

		// Comment Meta
		if ( ! empty( PodsMeta::$comment ) ) {
			$sql = "
                DELETE `rel`
                FROM `@wp_commentmeta` AS `rel`
                LEFT JOIN `{$wpdb->posts}` AS `p`
                    ON
                        `p`.`post_type` = '_pods_field'
                LEFT JOIN `{$wpdb->postmeta}` AS `pm`
                    ON
                        `pm`.`post_id` = `p`.`ID`
                        AND `pm`.`meta_key` = 'type'
                        AND `pm`.`meta_value` IN ( {$file_types} )
                WHERE
                    `p`.`ID` IS NOT NULL
                    AND `pm`.`meta_id` IS NOT NULL
                    AND `rel`.`meta_key` = `p`.`post_name`
                    AND `rel`.`meta_value` = '{$_ID}'";

			pods_query( $sql, false );
		}
	}
419977
public function save($table_name, $data) {

            // Insert
            if (empty($data['id'])) {
                return $this->insert($table_name, $data);
            } // Update
            else {
                $id = $data['id'];
                unset($data['id']);

                return $this->update($table_name, $id, $data);
            }
        }
52236
public function canDelete($collection_id)
    {
        $sql = 'SELECT collection_item_id FROM collection_item WHERE collection_id=?';
        $result = $this->db->fetchColumn($sql, array($collection_id));
        return empty($result);
    }