src/Collection.php
public function getAllValuesForProperty($name)
    {
        $values = [];
        foreach ($this as $entity) {
            if (isset($entity->$name)) {
                $value = $entity->$name;
                if (!($value === null || $value instanceof Collection && $value->isEmpty())) {
                    if (is_scalar($value)) {
                        $values[$value] = $value;
                    } else {
                        $values[] = $value;
                    }
                }
            }
        }

        return array_values($values);
    }
public function getAllValuesForProperty($name)
    {
        $values = [];
        foreach ($this as $entity) {
            if (isset($entity->$name)) {
                $value = $entity->$name;
                if (!($value === null || $value instanceof Collection && $value->isEmpty())) {
                    if (is_scalar($value)) {
                        $values[$value] = $value;
                    } else {
                        $values[] = $value;
                    }
                }
            }
        }

        return array_values($values);
    }
Return values from all entities from given property

@param string $name name

@return array