Tells whether the Collection contains an object

@param  ValueObjectInterface $object
@return bool
195034
public function contains(ValueObjectInterface $object)
    {
        foreach ($this->items as $item) {
            if ($item->sameValueAs($object)) {
                return true;
            }
        }

        return false;
    }
129557
protected function parseObject(ObjectInterface $object, array $data)
    {
        foreach ($data as $index => $value) {
            if (false !== strpos($index, '$')) {
                $index = str_replace('$', '_', $index);
            }

            if (property_exists($object, $index)) {
                $object = $this->parseProperty($object, $index, $value);
            } elseif (true == ($fieldTypeClassName = $object->isFieldPatternedField($index))) {
                $object = $this->parsePatternedField($object, $fieldTypeClassName, $index, $value);
            }
        }

        return $object;
    }
183330
public function sameValueAs(ValueObjectInterface $street)
    {
        if (false === Util::classEquals($this, $street)) {
            return false;
        }

        return $this->getName()->sameValueAs($street->getName()) &&
               $this->getNumber()->sameValueAs($street->getNumber()) &&
               $this->getElements()->sameValueAs($street->getElements());
        ;
    }
820294
final protected function checkArrayCollection($object)
    {
        return $object instanceof \Doctrine\Common\Collections\ArrayCollection || $object instanceof \Doctrine\ORM\PersistentCollection;
    }
686629
public function hasRequirement($object, $requirement = null)
    {
        return isset($this->requirements[$object])
            && ($requirement === null || in_array($requirement, $this->requirements[$object], true));
    }
235693
public static function isAnymous($object)
    {
        if(!is_string($object))
        {
            $object = get_class($object);
        }
        $index = strpos($object, 'class@anonymous');
        return false !== $index && $index >= 0;
    }
291982
public function sameValueAs(ValueObjectInterface $url)
    {
        if (false === Util::classEquals($this, $url)) {
            return false;
        }

        return $this->getScheme()->sameValueAs($url->getScheme()) &&
               $this->getUser()->sameValueAs($url->getUser()) &&
               $this->getPassword()->sameValueAs($url->getPassword()) &&
               $this->getDomain()->sameValueAs($url->getDomain()) &&
               $this->getPath()->sameValueAs($url->getPath()) &&
               $this->getPort()->sameValueAs($url->getPort()) &&
               $this->getQueryString()->sameValueAs($url->getQueryString()) &&
               $this->getFragmentIdentifier()->sameValueAs($url->getFragmentIdentifier())
        ;
    }
913405
private static function canBeSerializedAsValue($object)
    {
        $result = true;
        self::traverse(false, $object, function ($obj) use (&$result)
        {
            // short circuit as soon as possible.
            if ($result === false)
            {
                return;
            }
            // cannot make a pointer to an unsaved object.
            if ($obj instanceof AVObject)
            {
                if (!$obj->getObjectId())
                {
                    $result = false;

                    return;
                }
            }
        });

        return $result;
    }
869771
public function sameValueAs(ValueObjectInterface $coordinate)
    {
        if (false === Util::classEquals($this, $coordinate)) {
            return false;
        }

        return $this->getLatitude()->sameValueAs($coordinate->getLatitude())   &&
               $this->getLongitude()->sameValueAs($coordinate->getLongitude()) &&
               $this->getEllipsoid()->sameValueAs($coordinate->getEllipsoid())
        ;
    }
568965
public function equals($object)
    {
        if (!($object instanceof self) || !self::compatibles(get_class($object), static::class)) {
            return false;
        }

        return $this->value() == $object->value();
    }
957302
public function isManyManyRelation(DataObject $object, $name)
    {
        return (boolean) $this->getSchema()->manyManyComponent($object, $name);
    }
957567
public static function isSelected($value, $valueObject)
    {
        if(is_array($value) && count($value) > 0)
        {
            return in_array($valueObject, $value);
        }

        if($value instanceof Collection)
        {
            foreach($value as $v)
            {
                if($v->getKey() === $valueObject)
                {
                    return true;
                }
            }
            return false;
        }
        elseif($value === $valueObject)
        {
            return true;
        }
        return false;
    }
461739
public function exists(string $object) : bool
    {
        return (!empty($this->registry) && isset($this->registry[$object]));
    }
1266421
public function sameValueAs(ValueObjectInterface $date)
    {
        if (false === Util::classEquals($this, $date)) {
            return false;
        }

        return $this->getYear()->sameValueAs($date->getYear()) &&
               $this->getMonth()->sameValueAs($date->getMonth()) &&
               $this->getDay()->sameValueAs($date->getDay());
    }
1313535
public function hasObject($object)
    {
        $oid = spl_object_hash($object);
        if (!isset($this->objectsRepository[$oid])) {
            return false;
        }
        $repository = $this->objectsRepository[$oid];
        $data = $repository->getHydrator()->unhydrate($object);
        $id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;

        return isset($this->objects[$oid]) || isset($this->objects[$id]);
    }
1117706
public function isNewObject($object)
    {
        return ($this->entityManager->getUnitOfWork()->getEntityState($object, \Doctrine\ORM\UnitOfWork::STATE_NEW) === \Doctrine\ORM\UnitOfWork::STATE_NEW);
    }
593252
public function isValidType($object): bool
    {
        if ($this->type == null || $object == null) {
            return true;
        }

        if (is_object($object) && get_class($object) == $this->type) {
            return true;
        }

        return (MDataType::getType($object) == $this->type);
    }