protected function extractLabel($object)
    {
        if ($this->property) {
            if ($this->property instanceof \Closure) {
                return $this->property->__invoke($object);
            } else {
                return $this->accessor->getValue($object, $this->property);
            }
        } elseif (method_exists($object, '__toString')) {
            return (string)$object;
        } else {
            throw new \Exception('"choice_label" option or "__toString" method must be defined"');
        }
    }
protected function extractLabel($object)
    {
        if ($this->property) {
            if ($this->property instanceof \Closure) {
                return $this->property->__invoke($object);
            } else {
                return $this->accessor->getValue($object, $this->property);
            }
        } elseif (method_exists($object, '__toString')) {
            return (string)$object;
        } else {
            throw new \Exception('"choice_label" option or "__toString" method must be defined"');
        }
    }
protected function extractLabel ( $ object ) { if ( $ this -> property ) { if ( $ this -> property instanceof \ Closure ) { return $ this -> property -> __invoke ( $ object ) ; } else { return $ this -> accessor -> getValue ( $ object , $ this -> property ) ; } } elseif ( method_exists ( $ object , '__toString' ) ) { return ( string ) $ object ; } else { throw new \ Exception ( '"choice_label" option or "__toString" method must be defined"' ) ; } }
Extract property that should be used for displaying the entities as text in the HTML element
@param object $object
@throws \Exception
Extract property that should be used for displaying the entities as text in the HTML element