Collects list of objects in product list

@param Mage_Catalog_Block_Product_List_Upsell $object
@return Mage_Catalog_Model_Product[]
423868
public function collect($object)
    {
        $result = array();
        $products = $object->getItems();
        foreach ($products as $product) {
            $result[] = $product;
        }
        return $result;
    }
962055
public function getLabeledPropertiesToBeSet($object)
    {
        return array_filter($this->getLabeledProperties(), function (LabeledPropertyMetadata $labeledPropertyMetadata) use ($object) {
            return true === $labeledPropertyMetadata->getValue($object);
        });
    }
753929
public function extract($object)
    {
        $data = [
            'group_id' => $object->getGroup()->getId(),
            'name' => $object->getName(),
        ];
        if ($object->getId()) {
            $data['id'] = $object->getId();
        }
        return $data;
    }
341926
public function getPropertyValuesArray($object)
    {
        $values = [];
        foreach ($this->entityPropertiesMetadata as $entityPropertyMetadata) {
            $v = $entityPropertyMetadata->getValue($object);
            if (is_object($v)) {
                switch (get_class($v)) {
                    case \DateTime::class:
                        $v = $v->getTimestamp();
                        break;
                }
            }
            $values[$entityPropertyMetadata->getPropertyName()] = $v;
        }

        return $values;
    }
969458
protected function getActorFromObject($object)
    {
        $entryObject = [null, null, null];

        if (is_object($object)) {
            $entryObject[2] = $object->getId();
            $pathParts      = explode('\\', get_class($object));
            $entryObject[1] = array_pop($pathParts);
            foreach ($pathParts as $pathPart) {
                if (strstr($pathPart, 'Bundle')) {
                    $entryObject[0] = $pathPart;
                    break;
                }
            }
        }

        return $entryObject;
    }
406000
private function getInvitations($object)
    {
        // This must be an event with a full company call.
        if (!$object instanceof Event
            || !$object->getFullCompany()) {
            return [];
        }

        // Index existing invites so that we don't duplicate any.
        $existing = [];
        foreach ($object->getInvitations() as $existing_invitation) {
            $existing[] = $existing_invitation->getInvitee();
        }

        // Create and persist invitations for all active members of groups.
        $invitations = [];
        foreach ($object->getGroups() as $group) {
            foreach ($this->membership_provider->loadActiveMembershipsByProduction($group) as $membership) {
                // We can only act on our users.
                if (!$membership->getMember() instanceof UserInterface) {
                    continue;
                }

                // If this membership is active, has not expired and is not
                // already invited create new invitation.
                if ($membership->isActive()
                    && !$membership->isExpired()
                    && !in_array($membership->getMember()->getUsername(), $existing)
                ) {
                    // Create new invitation to this event for this member.
                    $invite = new Invitation();
                    $invite->setEvent($object);
                    $invite->setInvitee($membership->getMember()->getUsername());
                    $invite->setOptional(false);
                    $invitations[] = $invite;
                }
            }
        }

        // Return the new invitations for this event.
        return $invitations;
    }
287497
public static function values($object)
    {
        if ($object instanceof \stdClass)
            $object = (array)$object;

        if (is_array($object))
            return array_values($object);

        $result = [];
        static::each($object, function ($item) use (& $result) {
            $result[] = $item;
        });

        return $result;
    }
1077497
public static function exportObjectMethods($object) {
        $methods = [];
        foreach (get_class_methods($object) as $method) {
            if ($method[0] === '_') {
                continue;
            }
            $methods[$method] = [$object, $method];
        }
        return $methods;
    }
342814
public function build(array $buildSubject) {
        return [
            'metadata' => [
                'magento_name'      => $this->metadata->getName(),
                'magento_edition'   => $this->metadata->getEdition(),
                'magento_version'   => $this->metadata->getVersion(),
                'setup_version'     => $this->moduleList->getOne('CheckoutCom_Magento2')['setup_version'],
                'module_version'    => $this->helper->getModuleVersion(),
                'store_id'          => $this->storeManager->getStore()->getId(),
            ],
        ];
    }
658727
public function getRelationList(DataObject $object, $field)
    {
        if ($this->isHasManyRelation($object, $field)) {
            return $object->getComponents($field);
        } elseif ($this->isManyManyRelation($object, $field)) {
            return $object->getManyManyComponents($field);
        }
    }
1027765
public function getCustomFields($object)
    {
        $customFields = [];
        foreach ($object->getCustomFields() as $field) {
            $customFields[$field->getInternalFieldName()] = $field->getValue();
        }

        return $customFields;
    }
1366887
protected function _collectTags($object)
    {
        // Clear category cache for new products
        if ($this->_isForUpdate && !$object->getId()) {
            $result = array();
            foreach ($object->getCategoryIds() as $categoryId) {
                $result[] = EcomDev_Varnish_Model_Processor_Category::TAG_PREFIX . $categoryId;
            }
            return $result;
        }
        
        return self::TAG_PREFIX . $object->getId();
    }
247901
public function serialize(DomainMessage $object)
    {
        return [
            'id' => $object->getId(),
            'playhead' => $object->getPlayhead(),
            'metadata' => $this->metadataSerializer->serialize($object->getMetadata()),
            'payload' => $this->payloadSerializer->serialize($object->getPayload()),
            'recordedOn' => $object->getRecordedOn()->toString()
        ];
    }
1113649
public function extract( $object )
    {
        $result = array();
        $type   = $object->paragraph->type;

        $result['paragraph-' . $type] = $this->getParagraphMapper()
                                             ->extract( $object->paragraph );

        $propertyHydrator = $this->getHydrateSimpleProperties();

        foreach ( $object->rules as $key => $rule )
        {
            $result['customize-' . $key] = $propertyHydrator->extract( $rule )
                                                              [ 'properties' ];
        }

        return $result;
    }
63117
public function toArray($object)
    {
        $result = array();
        $className = $this->getFullClassName($object);
        $metadata = $this->metadataFactory->getMetadataForClass($className);
        foreach ($metadata->getProperties() as $property) {
            if (!$property->isExpose() || $this->propertySkipper->shouldSkip($property)) {
                continue;
            }

            $value = $this->exposeValue($object, $property);
            $value = $this->handleValue($value, $property, self::DIRECTION_SERIALIZE);

            if ($property->isNullSkipped() && $value === null) {
                continue;
            }

            $result[$property->getSerializedName()] = $value;
        }

        return $result;
    }
38802
public function extract($object)
    {
        $pdfConverterHydrator = new PdfConverterHydrator();

        return [
            'responseStatus' => $object->getResponseStatus(),
            'sourceContainer' => $pdfConverterHydrator->extract($object->getSourceContainer()),
            'url' => $object->getUrl(),
        ];
    }
986558
protected function normalize($object)
    {
        // If its a paginator instance, create a collection with its items.
        if ($object instanceof Paginator) {
            return collect($object->items());
        } elseif (is_array($object)) {
            // If its an array, package it in a collection.
            return collect($object);
        }

        return $object;
    }