Group items in the collection by a field and return them as associated array of collections.

@param string $property
@return static[]
494361
public function collectionGroup($property)
    {
        $collections = [];
        foreach ($this->group($property) as $id => $elements) {
            $collection = $this->createFrom($elements);

            $collections[$id] = $collection;
        }

        return $collections;
    }
1204423
public function get($property = '')
    {
        $data = $this->getData();

        if (! $property) {
            return $data;
        }

        return array_get($data, $property, '');
    }
1246175
private function generateGetPropertyClosure( $property )
    {
        $mapper = $this->getPropertyMapper($property);
        return function( $obj ) use ( $mapper ) {
            return $mapper->get($obj);
        };
    }
918944
public static function getSetting($setting = null, $property = null) {
		$data = self::getStatic();
		$keys = [];
		if (isset($setting)) {
			$keys[] = $setting;
			if (isset($property)) {
				$keys[] = $property;
			}
		}
		return array_key_get($data, $keys);
	}
269822
public function unsetProperty($property) {
		foreach ($this->_data as &$item) {
			unset($item[$property]);
		}
		unset($item);
		
		return $this;
	}
525893
public function find($value, $property = null, $strict = false): array
    {
        $found = [];

        foreach ($this as $key => $obj) {
            if (!is_null($property)) {
                $exists = false;
                $value = b_property_get($obj, $property, $exists);

                if ($exists === true) {
                    if ((true === $strict && $value === $value)
                        || (false === $strict && $value == $value)
                    ) {
                        $found[] = $obj;
                    }
                }
            } else {
                if ((true === $strict && $key === $value)
                    || (false === $strict && $key == $value)
                ) {
                    $found[] = $obj;
                }
            }
        }

        return $found;
    }
681282
public function groupBy($groupBy)
	{
		if ( ! $this->useAsCallable($groupBy))
		{
			return $this->groupBy($this->valueRetriever($groupBy));
		}

		$results = [];

		foreach ($this->items as $key => $value)
		{
			$results[$groupBy($value, $key)][] = $value;
		}

		return new static($results);
	}
1049930
public function collectionToArray($collection, $title = 'title')
     {
         $array = array();
         foreach ($collection as $item) {
             $getter = 'get'.ucfirst($title);
             $array[$item->getId()] = $item->$getter();
         }

         return $array;
     }
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;
    }
953973
public function group($property, $separator = null)
    {
        $list = [];

        /** @var NestedObjectInterface $element */
        foreach ($this->getIterator() as $element) {
            $list[(string) $element->getNestedProperty($property, null, $separator)][] = $element;
        }

        return $list;
    }
783031
public function getProperties($properties){
        $values= array();
        foreach ($properties as $key) {
            $values[$key]= $this->getProperty($key);
        }
        return $values;
    }
1117747
public function getCheckedUidsAsArray($property)
    {
        $array = array();
        $entities = $this->{'get' . ucfirst($property)}();

        foreach ($entities as $item) {
            $array[$item->getUid()] = $item->getUid();
        }

        return $array;
    }
299138
public function &__get($property)
    {
        $get[ $property ] = false;

        if (services()->has($property)) {
            $get[ $property ] = services()->get($property);
        }

        return $get[ $property ];
    }
1027542
public function getValidationRules(Property $property)
    {
        $key = $property->key;
        if (true === $property->canTranslate()) {
            return [
                [$key, ValuesValidator::class, 'skipOnEmpty' => true],
            ];
        } else {
            if ($property->allow_multiple_values) {
                return [
                    [$key, 'each', 'rule' => ['safe']],
                ];
            } else {
                return [
                    [$key, 'safe'],
                ];
            }
        }
    }
1345004
public function getProperty($property)
    {
        $values = array();
        foreach ($this->columns as $key => $col) {
            if (isset($col[$property])) {
                $values[$key] = $col[$property];
            } else {
                $values[$key] = null;
            }
        }
    }
407665
final public static function format_properties($properties) {
        foreach ($properties as $property => $definition) {
            // Ensures that null is set to its default.
            if (!isset($definition['null'])) {
                $properties[$property]['null'] = NULL_NOT_ALLOWED;
            }
            if (!isset($definition['description'])) {
                $properties[$property]['description'] = $property;
            }

            // If an array is provided, it may be a nested array that is unformatted so rinse and repeat.
            if (is_array($definition['type'])) {
                $properties[$property]['type'] = static::format_properties($definition['type']);
            }
        }
        return $properties;
    }
676333
public function getValidationRules(Property $property)
    {
        $key = $property->key;
        if ($property->allow_multiple_values) {
            return [
                [$key, 'each', 'rule' => ['date']],
                [$key, 'each', 'rule' => ['default', 'value' => null]],
            ];
        } else {
            return [
                [$key, 'date'],
                [$key, 'default', 'value' => null],
            ];
        }
    }