src/Controllers/CommentingController.php
public function getOption($key)
    {
        // If possible use the current record
        if ($record = $this->getOwnerRecord()) {
            /** @var DataObject|CommentsExtension $record */
            return $record->getCommentsOption($key);
        }

        // Otherwise a singleton of that record
        if ($class = $this->getParentClass()) {
            return singleton($class)->getCommentsOption($key);
        }

        // Otherwise just use the default options
        return singleton(CommentsExtension::class)->getCommentsOption($key);
    }
public function getOption($key)
    {
        // If possible use the current record
        if ($record = $this->getOwnerRecord()) {
            /** @var DataObject|CommentsExtension $record */
            return $record->getCommentsOption($key);
        }

        // Otherwise a singleton of that record
        if ($class = $this->getParentClass()) {
            return singleton($class)->getCommentsOption($key);
        }

        // Otherwise just use the default options
        return singleton(CommentsExtension::class)->getCommentsOption($key);
    }
public function getOption ( $ key ) { // If possible use the current record if ( $ record = $ this -> getOwnerRecord ( ) ) { /** @var DataObject|CommentsExtension $record */ return $ record -> getCommentsOption ( $ key ) ; } // Otherwise a singleton of that record if ( $ class = $ this -> getParentClass ( ) ) { return singleton ( $ class ) -> getCommentsOption ( $ key ) ; } // Otherwise just use the default options return singleton ( CommentsExtension :: class ) -> getCommentsOption ( $ key ) ; }
Get the commenting option for the current state

@param string $key
@return mixed Result if the setting is available, or null otherwise
Get the commenting option for the current state