public function getLabel(\core_kernel_classes_Resource $delivery, $label = '')
    {
        $user = \common_session_SessionManager::getSession()->getUser();
        $customLabelRoles = $this->getOption(self::PROPERTY_CUSTOM_LABEL);
        if (array_intersect($customLabelRoles, $user->getRoles())) {
            $property = $this->getProperty(self::PROPERTY_CUSTOM_LABEL);
            if ((string)$delivery->getOnePropertyValue($property)) {
                $label = $delivery->getOnePropertyValue($property);
            }
        }
        return (string) $label;
    }
public function getLabel(\core_kernel_classes_Resource $delivery, $label = '')
    {
        $user = \common_session_SessionManager::getSession()->getUser();
        $customLabelRoles = $this->getOption(self::PROPERTY_CUSTOM_LABEL);
        if (array_intersect($customLabelRoles, $user->getRoles())) {
            $property = $this->getProperty(self::PROPERTY_CUSTOM_LABEL);
            if ((string)$delivery->getOnePropertyValue($property)) {
                $label = $delivery->getOnePropertyValue($property);
            }
        }
        return (string) $label;
    }
public function getLabel ( \ core_kernel_classes_Resource $ delivery , $ label = '' ) { $ user = \ common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ customLabelRoles = $ this -> getOption ( self :: PROPERTY_CUSTOM_LABEL ) ; if ( array_intersect ( $ customLabelRoles , $ user -> getRoles ( ) ) ) { $ property = $ this -> getProperty ( self :: PROPERTY_CUSTOM_LABEL ) ; if ( ( string ) $ delivery -> getOnePropertyValue ( $ property ) ) { $ label = $ delivery -> getOnePropertyValue ( $ property ) ; } } return ( string ) $ label ; }
Getting custom label from Delivery

@param \core_kernel_classes_Resource $delivery
@param string $label
@return string
Getting custom label from Delivery