/** * Checks if another statement is equal. * * Two statements are equal if and only if all of their properties are equal. * * @param Statement $statement The statement to compare with * * @return bool True if the statements are equal, false otherwise */ public function equals(Statement $statement) { if ($this->id !== $statement->id) { return false; } if (!$this->actor->equals($statement->actor)) { return false; } if (!$this->verb->equals($statement->verb)) { return false; } if (!$this->object->equals($statement->object)) { return false; } if (null === $this->result && null !== $statement->result) { return false; } if (null !== $this->result && null === $statement->result) { return false; } if (null !== $this->result && !$this->result->equals($statement->result)) { return false; } if (null === $this->authority && null !== $statement->authority) { return false; } if (null !== $this->authority && null === $statement->authority) { return false; } if (null !== $this->authority && !$this->authority->equals($statement->authority)) { return false; } return true; }
/** * {@inheritdoc} */ public function equals(Object $statement) { if ('Xabbuh\\XApi\\Model\\SubStatement' !== get_class($statement)) { return false; } /** @var SubStatement $statement */ if ($this->id !== $statement->id) { return false; } if (!$this->actor->equals($statement->actor)) { return false; } if (!$this->verb->equals($statement->verb)) { return false; } if (!$this->object->equals($statement->object)) { return false; } if (null === $this->result && null !== $statement->result) { return false; } if (null !== $this->result && null === $statement->result) { return false; } if (null !== $this->result && !$this->result->equals($statement->result)) { return false; } return true; }
/** * Checks if another statement is equal. * * Two statements are equal if and only if all of their properties are equal. * * @param Statement $statement The statement to compare with * * @return bool True if the statements are equal, false otherwise */ public function equals(Statement $statement) { if (null !== $this->id xor null !== $statement->id) { return false; } if (null !== $this->id && null !== $statement->id && !$this->id->equals($statement->id)) { return false; } if (!$this->actor->equals($statement->actor)) { return false; } if (!$this->verb->equals($statement->verb)) { return false; } if (!$this->object->equals($statement->object)) { return false; } if (null === $this->result && null !== $statement->result) { return false; } if (null !== $this->result && null === $statement->result) { return false; } if (null !== $this->result && !$this->result->equals($statement->result)) { return false; } if (null === $this->authority && null !== $statement->authority) { return false; } if (null !== $this->authority && null === $statement->authority) { return false; } if (null !== $this->authority && !$this->authority->equals($statement->authority)) { return false; } if ($this->created != $statement->created) { return false; } if (null !== $this->context xor null !== $statement->context) { return false; } if (null !== $this->context && null !== $statement->context && !$this->context->equals($statement->context)) { return false; } if (null !== $this->attachments xor null !== $statement->attachments) { return false; } if (null !== $this->attachments && null !== $statement->attachments) { if (count($this->attachments) !== count($statement->attachments)) { return false; } foreach ($this->attachments as $key => $attachment) { if (!$attachment->equals($statement->attachments[$key])) { return false; } } } return true; }
/** * {@inheritdoc} */ public function equals(Object $statement) { if ('Xabbuh\\XApi\\Model\\SubStatement' !== get_class($statement)) { return false; } /** @var SubStatement $statement */ if (!$this->actor->equals($statement->actor)) { return false; } if (!$this->verb->equals($statement->verb)) { return false; } if (!$this->object->equals($statement->object)) { return false; } if (null === $this->result && null !== $statement->result) { return false; } if (null !== $this->result && null === $statement->result) { return false; } if (null !== $this->result && !$this->result->equals($statement->result)) { return false; } if ($this->timestamp != $statement->timestamp) { return false; } if (null !== $this->context xor null !== $statement->context) { return false; } if (null !== $this->context && null !== $statement->context && !$this->context->equals($statement->context)) { return false; } if (null !== $this->attachments xor null !== $statement->attachments) { return false; } if (null !== $this->attachments && null !== $statement->attachments) { if (count($this->attachments) !== count($statement->attachments)) { return false; } foreach ($this->attachments as $key => $attachment) { if (!$attachment->equals($statement->attachments[$key])) { return false; } } } return true; }