Codesleeve\Stapler\Attachment::getInstanceClass PHP Method

getInstanceClass() public method

Returns the class type of the attachment's underlying model instance.
public getInstanceClass ( ) : string
return string
    public function getInstanceClass()
    {
        return get_class($this->instance);
    }

Usage Example

Example #1
0
 /**
  * Returns the current class name, exclusively taking into account namespaces, e.g
  * 'Swingline\Stapler' will become Swingline.
  *
  * @param Attachment $attachment
  * @param string $styleName
  * @return string
  */
 protected function getNamespace(Attachment $attachment, $styleName = '')
 {
     $classComponents = explode('\\', $attachment->getInstanceClass());
     return implode('/', array_slice($classComponents, 0, count($classComponents) - 1));
 }
All Usage Examples Of Codesleeve\Stapler\Attachment::getInstanceClass