/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof Arguments) { return false; } return $this->toArray() == $other->toArray(); }
public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof RouteSpecification) { return false; } return EqualsBuilder::create()->append($this->origin(), $other->origin())->append($this->destination(), $other->destination())->equals(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof RoleDescription) { return false; } return EqualsBuilder::create()->append($this->name()->sameValueAs($other->name()), true)->append($this->options()->sameValueAs($other->options()), true)->strict()->equals(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof LazyItemsLoader) { return false; } return $this->toJSON() === $other->toJSON(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof WorkflowRunId) { return false; } return $this->toString() === $other->toString(); }
/** * @param ValueObjectInterface $other * @return bool */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof Leg) { return false; } return EqualsBuilder::create()->append($this->loadLocation(), $other->loadLocation())->append($this->unloadLocation(), $other->unloadLocation())->append($this->loadTime()->getTimestamp(), $other->loadTime()->getTimestamp())->append($this->unloadTime()->getTimestamp(), $other->unloadTime()->getTimestamp())->equals(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof EventsDefinition) { return false; } if (count($this->eventDescriptions()) !== count($other->eventDescriptions())) { return false; } foreach ($this->eventDescriptions() as $eventName => $eventDescription) { if (!isset($other->eventDescriptions()[$eventName])) { return false; } if (!$eventDescription->sameValueAs($other->eventDescriptions()[$eventName])) { return false; } } return true; }
/** * @param ValueObjectInterface $other * @return bool */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof Itinerary) { return false; } //We use doctrine's ArrayCollection only to ease comparison //If Legs would be stored in an ArrayCollection hole the time //Itinerary itself would not be immutable, //cause a client could call $itinerary->legs()->add($anotherLeg); //Keeping ValueObjects immutable is a rule of thumb $myLegs = new ArrayCollection($this->legs()); $otherLegs = new ArrayCollection($other->legs()); if ($myLegs->count() !== $otherLegs->count()) { return false; } return $myLegs->forAll(function ($index, Leg $leg) use($otherLegs) { return $otherLegs->exists(function ($otherIndex, Leg $otherLeg) use($leg) { return $otherLeg->sameValueAs($leg); }); }); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof Item) { return false; } return $this->data() === $other->data(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof StructureDefinition) { return false; } if (count($this->structureItems()) !== count($other->structureItems())) { return false; } foreach ($this->structureItems() as $i => $structureItem) { if (!$structureItem->sameValueAs($other->structureItems()[$i])) { return false; } } return true; }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof ActionDescription) { return false; } if ($this->hasStructureDefinition()) { if (!$other->hasStructureDefinition()) { return false; } if (!$this->structureDefinition()->sameValueAs($other->structureDefinition())) { return false; } } if (!$this->hasStructureDefinition() && $other->hasStructureDefinition()) { return false; } if (!is_null($this->eventsDefinition()) && !is_null($other->eventsDefinition())) { if (!$this->eventsDefinition()->sameValueAs($other->eventsDefinition())) { return false; } } else { if (!is_null($this->eventsDefinition()) && is_null($other->eventsDefinition())) { return false; } else { if (is_null($this->eventsDefinition()) && !is_null($other->eventsDefinition())) { return false; } } } return EqualsBuilder::create()->append($this->name()->sameValueAs($other->name()), true)->append($this->type()->sameValueAs($other->type()), true)->append($this->arguments()->sameValueAs($other->arguments()), true)->strict()->equals(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof ProcessStep) { return false; } if ($this->isAgentDescription()) { if (!$other->isAgentDescription()) { return false; } return $this->agentDescription()->sameValueAs($other->agentDescription()); } else { if ($other->isAgentDescription()) { return false; } return EqualsBuilder::create()->append($this->roleDescription()->sameValueAs($other->roleDescription()), true)->append($this->actionDescription()->sameValueAs($other->actionDescription()), true)->equals(); } }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof WorkflowDescription) { return false; } if (!$this->workflowId()->sameValueAs($other->workflowId())) { return false; } if (count($this->processSteps()) !== count($other->processSteps())) { return false; } $otherProcessSteps = $other->processSteps(); foreach ($this->processSteps() as $index => $processStep) { if (!$processStep->sameValueAs($otherProcessSteps[$index])) { return false; } } return true; }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof StructureItem) { return false; } return EqualsBuilder::create()->append($this->key(), $other->key())->append($this->pathKeys(), $other->pathKeys())->append($this->valueType(), $other->valueType())->strict()->equals(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof ItemCollection) { return false; } if ($this->count() !== $other->count()) { return false; } foreach ($this->itemCollection as $myItem) { if (!$other->has($myItem)) { return false; } } return true; }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof MetaInformation) { return false; } return EqualsBuilder::create()->append($this->workflowRunId()->toString(), $other->workflowRunId()->toString())->append($this->actionId()->toString(), $other->actionId()->toString())->append($this->actionName()->toString(), $other->actionName()->toString())->append($this->actionArguments()->toArray(), $other->actionArguments()->toArray())->append($this->resultSetCount(), $other->resultSetCount())->equals(); }
/** * @param ValueObjectInterface $other * @return boolean */ public function sameValueAs(ValueObjectInterface $other) { if (!$other instanceof AgentDescription) { return false; } if (count($this->processSteps()) != count($other->processSteps())) { return false; } if ($this->type() !== $other->type()) { return false; } if (!$this->options()->sameValueAs($other->options())) { return false; } foreach ($this->processSteps() as $i => $processStep) { if (!$processStep->sameValueAs($other->processSteps()[$i])) { return false; } } return true; }