Translation::deletePhrase PHP Méthode

deletePhrase() public méthode

This can be called statically or as a member function. If called statically, you must give it an argument.
public deletePhrase ( $p_phraseId = null )
    public function deletePhrase($p_phraseId = null)
    {
        global $g_ado_db;
        if (is_null($p_phraseId)) {
            $p_phraseId = $this->m_data['phrase_id'];
            $this->m_exists = false;
        }
        $sql = "DELETE FROM Translations WHERE phrase_id = " . (int) $p_phraseId;
        $g_ado_db->Execute($sql);
    }

Usage Example

Exemple #1
0
    public function delete()
    {
        if (!$this->exists()) {
            return false;
        }
        // Deleting the from from disk path is the most common place for
        // something to go wrong, so we do that first.
        $file = $this->getStorageLocation();
        if (file_exists($file) && is_file($file)) {
            unlink($file);
        }

        // Delete all the references to this image.
        ArticleAttachment::OnAttachmentDelete($this->m_data['id']);

        // Delete the description
        Translation::deletePhrase($this->m_data['fk_description_id']);

        $tmpData = $this->m_data;

        // Delete the record in the database
        $success = parent::delete();

        $logtext = getGS('File #$1 "$2" deleted.', $tmpData['id'], $tmpData['file_name']);
        Log::Message($logtext, null, 39);
        return $success;
    } // fn delete
All Usage Examples Of Translation::deletePhrase