/** * Returns the index of a "property group" (the first object in the flat array that features * the specified property). Returns false if property id could not be found. * * @param PropertyId $propertyId * * @return bool|int */ private function getPropertyGroupIndex(PropertyId $propertyId) { $i = 0; foreach ($this->byId as $serializedPropertyId => $objects) { $pId = new PropertyId($serializedPropertyId); if ($pId->equals($propertyId)) { return $i; } $i += count($objects); } return false; }