Airship\Cabin\Bridge\Landing\Author::edit PHP Method

edit() public method

Update an existing author's profile
public edit ( string $authorId = '' )
$authorId string
    public function edit(string $authorId = '')
    {
        $authorId = (int) $authorId;
        if (!$this->isSuperUser()) {
            $authorsForUser = $this->author->getAuthorIdsForUser($this->getActiveUserId());
            // Check
            if (!\in_array($authorId, $authorsForUser)) {
                \Airship\redirect($this->airship_cabin_prefix . '/author');
            }
        }
        $post = $this->post(new AuthorFilter());
        if (!empty($post['name'])) {
            if ($this->author->updateAuthor($authorId, $post)) {
                \Airship\redirect($this->airship_cabin_prefix . '/author');
            }
        }
        $this->lens('author/edit', ['author' => $this->author->getById($authorId)]);
    }