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

createAuthor() public method

Create a new Author profile
public createAuthor ( array $post ) : boolean
$post array
return boolean
    public function createAuthor(array $post) : bool
    {
        $this->db->beginTransaction();
        $slug = $this->makeGenericSlug($post['name'], 'hull_blog_authors', 'slug');
        $authorId = $this->db->insertGet('hull_blog_authors', ['name' => $post['name'], 'byline' => $post['byline'] ?? '', 'bio_format' => $post['format'] ?? 'Markdown', 'biography' => $post['biography'] ?? '', 'slug' => $slug], 'authorid');
        $this->db->insert('hull_blog_author_owners', ['authorid' => $authorId, 'userid' => $this->getActiveUserId(), 'in_charge' => true]);
        return $this->db->commit();
    }