OnAuthorTypeDelete() public static method

Remove author pointers for the given author type.
public static OnAuthorTypeDelete ( integer $p_authorTypeId ) : void
$p_authorTypeId integer
return void
Example #1
0
 /**
  * @return boolean
  */
 public function delete()
 {
     if (!$this->exists()) {
         return false;
     }
     // Unlink articles
     ArticleAuthor::OnAuthorTypeDelete($this->getId());
     // Unlink authors
     AuthorAssignedType::OnAuthorTypeDelete($this->getId());
     // Delete this author type
     $authorType = $this->getName();
     $result = parent::delete();
     return $result;
 }
Example #2
0
    /**
     * @return boolean
     */
    public function delete()
    {
        if (!$this->exists()) {
            return false;
        }

        // Unlink articles
        ArticleAuthor::OnAuthorTypeDelete($this->getId());
        // Unlink authors
        AuthorAssignedType::OnAuthorTypeDelete($this->getId());
        // Delete this author type
        $authorType = $this->getName();
        $result = parent::delete();
        if ($result) {
            if (function_exists("camp_load_translation_strings")) {
                camp_load_translation_strings("api");
            }
            $logText = getGS('Article type "$1" deleted.', $authorType);
            Log::Message($logText, null, 176);
        }
        return $result;
    }