Gets all of the values for a subject's property as an array.

@param stdClass $subject the subject.
@param string $property the property.

@return array all of the values for a subject's property as an array.
764115
public static function getValues($subject, $property) {
    $rval = (property_exists($subject, $property) ?
      $subject->{$property} : array());
    return self::arrayify($rval);
  }
1335302
protected function getPermissionsForSubject(Subject $subject)
    {
        $permissions = [];

        foreach ($this->getRolesForSubject($subject) as $role) {
            if ($role->hasPermissions()) {
                $permissions = array_merge($this->getPermissionsByNames($role->getPermissions()), $permissions);
            }
        }

        return $permissions;
    }
93416
protected function get($parts, $subject)
    {
        $part = array_shift($parts);

        if (!$this->has($part, $subject)) {
            $type = is_object($subject) ? get_class($subject) : gettype($subject);
            throw new \Exception(sprintf("Can't find %s in %s", $part, $type));
        } elseif (is_array($subject)) {
            $value = $subject[$part];
        } elseif (method_exists($subject, $part)) {
            $value = call_user_func(array($subject, $part));
        } else {
            $value = $subject->$part;
        }

        if (count($parts) == 0) {
            return $value;
        } else {
            return $this->get($parts, $value);
        }
    }
1196939
public static function getBindings($subjectModel = null) {
        if (is_null($subjectModel)) {
            return static::$_bindings;
        }
        return !empty(static::$_bindings[$subjectModel]) ? static::$_bindings[$subjectModel] : array();
    }
576065
private function getPropertyValue(array $property, $className = Entity::class)
    {
        $type = $this->getValueType($property);
        return $this->convertValue($type, $property[$type], $className);
    }
674960
private function useReflectionToGetMessage($subject)
    {
        $reflection = new \ReflectionClass($subject);
        $property   = $reflection->getProperty('_message');
        $property->setAccessible(true);
        $message = $property->getValue($subject);

        return $message;
    }
423146
private function getPropertySerializerGroups(string $resourceClass, string $property): array
    {
        $serializerClassMetadata = $this->serializerClassMetadataFactory->getMetadataFor($resourceClass);

        foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) {
            if ($property === $serializerAttributeMetadata->getName()) {
                return $serializerAttributeMetadata->getGroups();
            }
        }

        return [];
    }
18029
public function getKeyedByProperty($property)
    {
        $results = [];
        foreach ($this as $item) {
            $results[$item->$property] = $item;
        }
        return new static($results);
    }
809551
private function getValue(PropertyInterface $property)
    {
        $default = ['presentAs' => null, 'items' => []];
        if (!is_array($property->getValue())) {
            return $default;
        }

        return array_merge($default, $property->getValue());
    }
646875
public function pluckProperty($property)
    {
        $values = [];

        foreach ($this->models as $model) {
            $values []= $model->$property;
        }

        return $values;
    }
290826
public function check(Subject $subject): ResultCollection
    {
        $resultCollection = new ResultCollection();

        foreach ($this->collection as $rule) {
            $resultCollection->merge($rule->check($subject));
        }

        return $resultCollection;
    }
911708
public static function hasValue($subject, $property, $value) {
    $rval = false;
    if(self::hasProperty($subject, $property)) {
      $val = $subject->{$property};
      $is_list = self::_isList($val);
      if(is_array($val) || $is_list) {
        if($is_list) {
          $val = $val->{'@list'};
        }
        foreach($val as $v) {
          if(self::compareValues($value, $v)) {
            $rval = true;
            break;
          }
        }
      } else if(!is_array($value)) {
        // avoid matching the set of values with an array value parameter
        $rval = self::compareValues($value, $val);
      }
    }
    return $rval;
  }
727215
public function getPropertyValues($property)
    {
        $returnValue = null;
        switch ($property) {
            case GenerisRdf::PROPERTY_USER_DEFLG :
                $returnValue = array(DEFAULT_LANG);
                break;
            case GenerisRdf::PROPERTY_USER_UILG :
                $returnValue = array($this->language);
                break;
            case  GenerisRdf::PROPERTY_USER_ROLES :
                $returnValue = $this->taoRoles;
                break;
            case  GenerisRdf::PROPERTY_USER_FIRSTNAME :
                $returnValue = [$this->firstname];
                break;
            case  GenerisRdf::PROPERTY_USER_LASTNAME :
                $returnValue = [$this->lastname];
                break;
            case  OntologyRdfs::RDFS_LABEL :
                $returnValue = [$this->label];
                break;
            default:
                \common_Logger::d('Unkown property ' . $property . ' requested from ' . __CLASS__);
                $returnValue = array();
        }
        return $returnValue;
    }
599362
public function decorate($subject)
    {
        $items = $this->getItems($subject);

        foreach ($items->keys() as $key) {
            $items->put($key, $this->autoPresenter->decorate($items->get($key)));
        }

        return $subject;
    }
164519
public static function getPropertyValue($object, $property)
    {
        $ref = new \ReflectionClass($object);
        $prop = static::getPrivateProperty($ref, $property);
        $prop->setAccessible(true);
        $value = $prop->getValue($object);
        $prop->setAccessible(false);

        return $value;
    }
564566
public function loadSubjectObjectives($subject)
    {
        $target = $this->getSubjectType($subject);
        $repoMethod = "findBy{$target}";

        return $this->objectiveRepo->{$repoMethod}($subject);
    }
852699
private function getParameter(Property $property): array
    {
        $type = $property->getType();
        if (TypeChecker::isKnownType($type) && $this->options->useTypeHints()) {
            return [
                [
                    'name' => $property->getName(),
                    'type' => $type,
                ],
            ];
        }

        return [$property->getName()];
    }