src/Node.php
public function getCoverImage()
    {
        if ($this->coverImage)
        {
            return $this->coverImage;
        }

        $modelName = source_model_name($this->getNodeTypeName(), true);

        $mutatables = call_user_func([$modelName, 'getMutatables']);

        foreach ($mutatables as $mutatable => $type)
        {
            if ($type === 'gallery' && ($images = $this->getTranslationAttribute($mutatable, null, true, true)))
            {
                if ($cover = get_nuclear_cover($images))
                {
                    $this->coverImage = $cover;

                    return $cover;
                }
            }

            if ($type === 'document' && ($document = $this->getTranslationAttribute($mutatable, null, true, true)))
            {
                if ($document = get_nuclear_cover($document))
                {
                    $this->coverImage = $document;

                    return $document;
                }
            }
        }

        return null;
    }
public function getCoverImage()
    {
        if ($this->coverImage)
        {
            return $this->coverImage;
        }

        $modelName = source_model_name($this->getNodeTypeName(), true);

        $mutatables = call_user_func([$modelName, 'getMutatables']);

        foreach ($mutatables as $mutatable => $type)
        {
            if ($type === 'gallery' && ($images = $this->getTranslationAttribute($mutatable, null, true, true)))
            {
                if ($cover = get_nuclear_cover($images))
                {
                    $this->coverImage = $cover;

                    return $cover;
                }
            }

            if ($type === 'document' && ($document = $this->getTranslationAttribute($mutatable, null, true, true)))
            {
                if ($document = get_nuclear_cover($document))
                {
                    $this->coverImage = $document;

                    return $document;
                }
            }
        }

        return null;
    }
public function getCoverImage ( ) { if ( $ this -> coverImage ) { return $ this -> coverImage ; } $ modelName = source_model_name ( $ this -> getNodeTypeName ( ) , true ) ; $ mutatables = call_user_func ( [ $ modelName , 'getMutatables' ] ) ; foreach ( $ mutatables as $ mutatable => $ type ) { if ( $ type === 'gallery' && ( $ images = $ this -> getTranslationAttribute ( $ mutatable , null , true , true ) ) ) { if ( $ cover = get_nuclear_cover ( $ images ) ) { $ this -> coverImage = $ cover ; return $ cover ; } } if ( $ type === 'document' && ( $ document = $ this -> getTranslationAttribute ( $ mutatable , null , true , true ) ) ) { if ( $ document = get_nuclear_cover ( $ document ) ) { $ this -> coverImage = $ document ; return $ document ; } } } return null ; }
Gets the cover image

@return Image|null
Gets the cover image