AuthorAlias::OnAuthorDelete PHP Method

OnAuthorDelete() public static method

Remove alias pointers for the given author.
public static OnAuthorDelete ( integer $p_authorId ) : void
$p_authorId integer
return void
    public static function OnAuthorDelete($p_authorId)
    {
        global $g_ado_db;
        $queryStr = "DELETE FROM AuthorAliases WHERE fk_author_id = {$p_authorId}";
        $g_ado_db->Execute($queryStr);
    }

Usage Example

コード例 #1
0
ファイル: Author.php プロジェクト: nistormihai/Newscoop
    /**
     * @return boolean
     */
    public function delete()
    {
        if (!$this->exists()) {
            return false;
        }

        // Unlink articles
        ArticleAuthor::OnAuthorDelete($this->getId());
        // Unlink aliases
        AuthorAlias::OnAuthorDelete($this->getId());
        // Unlink authors
        AuthorAssignedType::OnAuthorDelete($this->getId());
        // Unlink biographies
        AuthorBiography::OnAuthorDelete($this->getId());

        // Save author data for logging purposes
        $tmpData = $this->m_data;
        // Delete row from Authors table.
        $result = parent::delete();
        if ($result) {
            if (function_exists("camp_load_translation_strings")) {
                camp_load_translation_strings("api");
            }
            $logText = getGS('Author #$1 "$2" deleted.',
                $tmpData['id'], $tmpData['first_name'] . ' ' . $tmpData['last_name']);
            Log::Message($logText, null, 174);
        }

        return $result;
    }
All Usage Examples Of AuthorAlias::OnAuthorDelete