src/Micrometa/Ports/Item/Item.php
public function getFirstProperty(...$properties)
    {
        /** @var ProfiledNamesList $properties */
        $properties = ProfiledNamesFactory::createFromArguments(func_get_args());

        // Prepare a default exception
        $exception = new OutOfBoundsException(
            OutOfBoundsException::NO_MATCHING_PROPERTIES_STR,
            OutOfBoundsException::NO_MATCHING_PROPERTIES
        );

        // Run through all properties
        foreach ($properties as $property) {
            try {
                return (array)$this->getProperty($property->name, $property->profile);
            } catch (OutOfBoundsException $exception) {
                continue;
            }
        }

        throw $exception;
    }
public function getFirstProperty(...$properties)
    {
        /** @var ProfiledNamesList $properties */
        $properties = ProfiledNamesFactory::createFromArguments(func_get_args());

        // Prepare a default exception
        $exception = new OutOfBoundsException(
            OutOfBoundsException::NO_MATCHING_PROPERTIES_STR,
            OutOfBoundsException::NO_MATCHING_PROPERTIES
        );

        // Run through all properties
        foreach ($properties as $property) {
            try {
                return (array)$this->getProperty($property->name, $property->profile);
            } catch (OutOfBoundsException $exception) {
                continue;
            }
        }

        throw $exception;
    }
public function getFirstProperty ( ... $ properties ) { /** @var ProfiledNamesList $properties */ $ properties = ProfiledNamesFactory :: createFromArguments ( func_get_args ( ) ) ; // Prepare a default exception $ exception = new OutOfBoundsException ( OutOfBoundsException :: NO_MATCHING_PROPERTIES_STR , OutOfBoundsException :: NO_MATCHING_PROPERTIES ) ; // Run through all properties foreach ( $ properties as $ property ) { try { return ( array ) $ this -> getProperty ( $ property -> name , $ property -> profile ) ; } catch ( OutOfBoundsException $ exception ) { continue ; } } throw $ exception ; }
Get all values of the first available property in a stack

The property stack can be specified in a variety of ways, @see ProfiledNamesFactory::createFromArguments()

@param array $properties Properties

@return ValueInterface[]|array Property values
@throws InvalidArgumentException If no property name was given
@throws OutOfBoundsException If none of the requested properties is known
@api
Get all values of the first available property in a stack