Check if the objects are part of a collection or not

@param $includeObject

@return array
553702
private function createIncludeObjects($includeObject)
    {
        if ($this->isCollection($includeObject)) {
            $includeObjects = $includeObject['data'];

            return $includeObjects;
        } else {
            $includeObjects = [$includeObject['data']];

            return $includeObjects;
        }
    }
754407
public function validateFields($oObject)
    {
        $aRequiredFields = $this->getRequiredFields();
        $oFieldValidator = $this->getFieldValidator();

        $aInvalidFields = [];
        foreach ($aRequiredFields as $sFieldName) {
            if (!$oFieldValidator->validateFieldValue($oObject->getFieldData($sFieldName))) {
                $aInvalidFields[] = $sFieldName;
            }
        }
        $this->_setInvalidFields($aInvalidFields);

        return empty($aInvalidFields);
    }
725395
protected function doesContainsObjects(array $objects) : bool
    {
        $this->toOrderedMap();

        foreach ($objects as $object) {
            if (!isset($this->instanceMap[$object])) {
                return false;
            }
        }

        return true;
    }
193399
protected function getIncluded(ElementInterface $element, $includeParent = false)
    {
        $included = [];

        foreach ($element->getResources() as $resource) {
            if ($resource->isIdentifier()) {
                continue;
            }

            if ($includeParent) {
                $included = $this->mergeResource($included, $resource);
            } else {
                $type = $resource->getType();
                $id = $resource->getId();
            }

            foreach ($resource->getUnfilteredRelationships() as $relationship) {
                $includedElement = $relationship->getData();

                if (! $includedElement instanceof ElementInterface) {
                    continue;
                }

                foreach ($this->getIncluded($includedElement, true) as $child) {
                    // If this resource is the same as the top-level "data"
                    // resource, then we don't want it to show up again in the
                    // "included" array.
                    if (! $includeParent && $child->getType() === $type && $child->getId() === $id) {
                        continue;
                    }

                    $included = $this->mergeResource($included, $child);
                }
            }
        }

        $flattened = [];

        array_walk_recursive($included, function ($a) use (&$flattened) {
            $flattened[] = $a;
        });

        return $flattened;
    }
373377
public function getScopeVariables($includeBoundObject = true)
    {
        $vars = $this->context->getAll();

        if (!$includeBoundObject) {
            unset($vars['this']);
        }

        return $vars;
    }
208721
public function getPublishedFieldArrays($object = 'lead')
    {
        if ('company' != $object) {
            $expr   = 'neq';
            $object = 'company';
        } else {
            $expr = 'eq';
        }

        return $this->getEntities(
            [
                'filter' => [
                    'force' => [
                        [
                            'column' => 'f.isPublished',
                            'expr'   => 'eq',
                            'value'  => true,
                        ],
                        [
                            'column' => 'f.object',
                            'expr'   => $expr,
                            'value'  => $object,
                        ],
                    ],
                ],
                'hydration_mode' => 'HYDRATE_ARRAY',
            ]
        );
    }
1040338
public static function getAllIdentifiers(bool $includeObsolete = false) : array
    {
        return \DateTimeZone::listIdentifiers(
            $includeObsolete
            ? \DateTimeZone::ALL_WITH_BC
            : \DateTimeZone::ALL
        );
    }
1373395
public function getLinksArray($includeOnlyVisited = false){
        $links = $this->getLinks();
        
        if($includeOnlyVisited === true){
            $links = array_filter($links, function (Link $linkObj) {
                /*@var $linkObj Link */
                return $linkObj->isVisited() === true;
            });
        }
        
        return array_map(function(Link $link){
            return [
              'fullUrl' => $link->getAbsoluteUrl(),
              'uri' => $link->getPath(),
              'metaInfo' => $link->getMetaInfoArray(),
              'parentLink' => $link->getParentUrl(),
              'statusCode' => $link->getStatusCode(), 
              'status' => $link->getStatus(), 
              'contentType' => $link->getContentType(), 
              'errorInfo' => $link->getErrorInfo(),
              'crawlDepth' => $link->getCrawlDepth(),              
            ];
        },$links);
    }
53504
private function cleanRelatedObjects(&$relatedObjects)
    {
        $existEmbObjects = [];
        foreach ($relatedObjects as $key => $existEmbObject) {
            $existEmbObjects[$key] = $existEmbObject;
            unset($relatedObjects[$key]);
        }

        return $existEmbObjects;
    }
1157004
protected function containsObject($subject)
    {
        if (is_object($subject)) {
            return true;
        }
        if (!is_array($subject)) {
            return false;
        }
        foreach ($subject as $value) {
            if ($this->containsObject($value)) {
                return true;
            }
        }
        return false;
    }
1117706
public function isNewObject($object)
    {
        return ($this->entityManager->getUnitOfWork()->getEntityState($object, \Doctrine\ORM\UnitOfWork::STATE_NEW) === \Doctrine\ORM\UnitOfWork::STATE_NEW);
    }
1018430
public function isValueObject($object)
    {
        if (!is_string($object)) {
            $object = get_class($object);
        }

        return array_key_exists($object, $this->valueClasses);
    }
1145322
function canAssignToObjectSectionList( $contentObject )
    {
        $access = $this->hasAccessTo( 'section', 'assign' );

        if ( $access['accessWord'] == 'yes' )
        {
            return array( '*' );
        }
        else if ( $access['accessWord'] == 'limited' )
        {
            $userID = $this->attribute( 'contentobject_id' );
            $classID = $contentObject->attribute( 'contentclass_id' );
            $ownerID = $contentObject->attribute( 'owner_id' );
            $sectionID = $contentObject->attribute( 'section_id' );

            $allowedSectionIDList = array();
            foreach ( $access['policies'] as $policy )
            {
                if ( ( isset( $policy['Class'] ) and !in_array( $classID, $policy['Class'] ) ) or
                     ( isset( $policy['Owner']  ) and in_array( 1, $policy['Owner'] ) and $userID != $ownerID ) or
                     ( isset( $policy['Section'] ) and !in_array( $sectionID, $policy['Section'] ) ) )
                {
                    continue;
                }
                if ( isset( $policy['NewSection'] ) && !empty( $policy['NewSection'] ) )
                {
                    $allowedSectionIDList = array_merge( $allowedSectionIDList, $policy['NewSection'] );
                }
                else
                {
                    return array( '*' );
                }
            }
            $allowedSectionIDList = array_unique( $allowedSectionIDList );
            return $allowedSectionIDList;
        }
        return array();
    }
165893
protected function objectToArray($object, array $exclude)
  {
    $array = (array) $this->objectToPublicObject($object, $exclude);

    foreach ($array as $key => $value)
    {
      if (is_object($value))
      {
        $value = $this->objectToArray($value, $this->excludeNext($key, $exclude));
      }
      $array[$key] = $value;
    }

    return $array;
  }
1079821
public function getSiblings($includeNode = true)
	{
		$parent = $this->getParent();
		$siblings = null;
		
		if ( ! is_null($parent)) {
			$siblings = $parent->getChildren();
		} else {
			$siblings = $this->repository->getRootNodes();
		}
		
		if ( ! $includeNode) {
			foreach ($siblings as $key => $sibling) {
				if ($sibling->isEqualTo($this)) {
					unset($siblings[$key]);
					break;
				}
			}
			// reset index
			$siblings = array_values($siblings);
		}
		
		return $siblings;
	}
942707
public static function getNotDeleted($objects)
    {
        if (null === $objects) {
            return null;
        }

        if (!$objects instanceof Collection) {
            $objects = new ArrayCollection($objects);
        }

        foreach ($objects as $object) {
            $functionDeletedOld = [
                $object,
                "getDeleted"
            ];

            $functionDeletedNew = [
                $object,
                "isDeleted"
            ];

            if (true === is_callable($functionDeletedOld) && true === $object->getDeleted()) {
                $objects->removeElement($object);
            } elseif (true === is_callable($functionDeletedNew) && true === $object->isDeleted()) {
                $objects->removeElement($object);
            }
        }

        return $objects;
    }
1092605
public function has($object) : bool
    {
        $hash = spl_object_hash($object);

        return isset($this->objects[$hash]);
    }