Airship\Cabin\Bridge\Blueprint\Author::reassignAuthorship PHP Method

reassignAuthorship() protected method

Overloadable. Reassign all entries that depend on the authors table in any capacity to a differnet author (or NULL).
protected reassignAuthorship ( integer $oldAuthorId, integer $newAuthorId )
$oldAuthorId integer
$newAuthorId integer = 0
    protected function reassignAuthorship(int $oldAuthorId, int $newAuthorId = 0)
    {
        if ($newAuthorId < 1) {
            $newAuthorId = null;
        }
        $this->db->update('airship_files', ['author' => $newAuthorId], ['author' => $oldAuthorId]);
        $this->db->update('hull_blog_comments', ['author' => $newAuthorId], ['author' => $oldAuthorId]);
        $this->db->update('hull_blog_posts', ['author' => $newAuthorId], ['author' => $oldAuthorId]);
        $this->db->update('hull_blog_series', ['author' => $newAuthorId], ['author' => $oldAuthorId]);
    }