You're looking for the ArrayCollection::removeElement
method here.
public function removeSchema(SchemaInterface $schema)
{
$this->schemata->removeElement($schema)
return $this;
}
tip:
You can use ArrayCollection::add
to add elements to an existing collection. OOP.
In some cases you may also want to check wether already contains the element before adding it.
public function addSchema(SchemaInterface $schema)
{
if (!$this->schemata->contains($schema)) {
$this->schemata->add($schema);
}
return $this;
}