OnAuthorDelete() public static method

Remove alias pointers for the given author.
public static OnAuthorDelete ( integer $p_authorId ) : void
$p_authorId integer
return void
Esempio n. 1
0
    /**
     * @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;
    }
Esempio n. 2
0
 /**
  * @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();
     return $result;
 }