concrete/src/Express/Entry/Formatter/LabelFormatter.php
public function format($mask, Entry $entry)
    {
        return $this->formatter->format($mask, function ($key) use ($entry) {
            if ($key === 'id') {
                return $entry->getID();
            }
            
            $attribute = $entry->getAttribute($key);
            if ($attribute) {
                return $attribute;
            }

            $association = $entry->getAssociation($key);
            if (is_object($association)) {
                return $association->getSelectedEntry()->getLabel();
            }
        });
    }
public function format($mask, Entry $entry)
    {
        return $this->formatter->format($mask, function ($key) use ($entry) {
            if ($key === 'id') {
                return $entry->getID();
            }
            
            $attribute = $entry->getAttribute($key);
            if ($attribute) {
                return $attribute;
            }

            $association = $entry->getAssociation($key);
            if (is_object($association)) {
                return $association->getSelectedEntry()->getLabel();
            }
        });
    }
public function format ( $ mask , Entry $ entry ) { return $ this -> formatter -> format ( $ mask , function ( $ key ) use ( $ entry ) { if ( $ key === 'id' ) { return $ entry -> getID ( ) ; } $ attribute = $ entry -> getAttribute ( $ key ) ; if ( $ attribute ) { return $ attribute ; } $ association = $ entry -> getAssociation ( $ key ) ; if ( is_object ( $ association ) ) { return $ association -> getSelectedEntry ( ) -> getLabel ( ) ; } } ) ; }
Format a mask given an entry
@param string $mask
@param \Concrete\Core\Entity\Express\Entry $entry
@return string|null
Format a mask given an entry