public function podiumEdit($isFirstPost = false)
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            $this->edited = 1;
            $this->touch('edited_at');
            if (!$this->save()) {
                throw new Exception('Post saving error!');
            }
            if ($isFirstPost) {
                $this->thread->name = $this->topic;
                if (!$this->thread->save()) {
                    throw new Exception('Thread saving error!');
                }
            }
            $this->markSeen();
            $this->thread->touch('edited_post_at');

            $transaction->commit();
            Log::info('Post updated', $this->id, __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
public function podiumEdit($isFirstPost = false)
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            $this->edited = 1;
            $this->touch('edited_at');
            if (!$this->save()) {
                throw new Exception('Post saving error!');
            }
            if ($isFirstPost) {
                $this->thread->name = $this->topic;
                if (!$this->thread->save()) {
                    throw new Exception('Thread saving error!');
                }
            }
            $this->markSeen();
            $this->thread->touch('edited_post_at');

            $transaction->commit();
            Log::info('Post updated', $this->id, __METHOD__);
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
public function podiumEdit ( $ isFirstPost = false ) { $ transaction = static :: getDb ( ) -> beginTransaction ( ) ; try { $ this -> edited = 1 ; $ this -> touch ( 'edited_at' ) ; if ( ! $ this -> save ( ) ) { throw new Exception ( 'Post saving error!' ) ; } if ( $ isFirstPost ) { $ this -> thread -> name = $ this -> topic ; if ( ! $ this -> thread -> save ( ) ) { throw new Exception ( 'Thread saving error!' ) ; } } $ this -> markSeen ( ) ; $ this -> thread -> touch ( 'edited_post_at' ) ; $ transaction -> commit ( ) ; Log :: info ( 'Post updated' , $ this -> id , __METHOD__ ) ; return true ; } catch ( Exception $ e ) { $ transaction -> rollBack ( ) ; Log :: error ( $ e -> getMessage ( ) , null , __METHOD__ ) ; } return false ; }
Performs post update with parent thread topic update in case of first post in thread.
@param bool $isFirstPost whether post is first in thread
@return bool
@since 0.2
Performs post update with parent thread topic update in case of first post in thread .