public function isEqualTo(EntityInterface $entity)
    {
        if ($entity->getType() !== $this->getType()) {
            return false;
        }

        if ($this->getType()->getAttributes()->getSize() !== $this->value_holder_map->getSize()) {
            return false;
        }

        foreach ($this->getType()->getAttributes()->getKeys() as $attribute_name) {
            $value_holder = $this->value_holder_map->getItem($attribute_name);
            if (!$value_holder->sameValueAs($entity->getValue($attribute_name))) {
                return false;
            }
        }

        return true;
    }
public function isEqualTo(EntityInterface $entity)
    {
        if ($entity->getType() !== $this->getType()) {
            return false;
        }

        if ($this->getType()->getAttributes()->getSize() !== $this->value_holder_map->getSize()) {
            return false;
        }

        foreach ($this->getType()->getAttributes()->getKeys() as $attribute_name) {
            $value_holder = $this->value_holder_map->getItem($attribute_name);
            if (!$value_holder->sameValueAs($entity->getValue($attribute_name))) {
                return false;
            }
        }

        return true;
    }
public function isEqualTo ( EntityInterface $ entity ) { if ( $ entity -> getType ( ) !== $ this -> getType ( ) ) { return false ; } if ( $ this -> getType ( ) -> getAttributes ( ) -> getSize ( ) !== $ this -> value_holder_map -> getSize ( ) ) { return false ; } foreach ( $ this -> getType ( ) -> getAttributes ( ) -> getKeys ( ) as $ attribute_name ) { $ value_holder = $ this -> value_holder_map -> getItem ( $ attribute_name ) ; if ( ! $ value_holder -> sameValueAs ( $ entity -> getValue ( $ attribute_name ) ) ) { return false ; } } return true ; }
Tells whether this entity is considered equal to another given entity.
Entities are equal when they have the same type and values.

@param EntityInterface $entity

@return boolean true on both entities have the same type and values; false otherwise.
Tells whether this entity is considered equal to another given entity . Entities are equal when they have the same type and values .