function equal_to(Modyllic_Schema_Index $other, array $fromnames = null) { if (!parent::equal_to($other)) { return false; } if ($this->references != $other->references) { return false; } if ($this->weak != $other->weak) { return false; } return true; }
function add_index(Modyllic_Schema_Index $key) { // If a semantically identical key already exists, replace it. $match = null; foreach ($this->ctx->indexes as $array_index => &$index) { if ($key->equal_to($index)) { $match = $array_index; break; } } if (isset($match)) { unset($this->ctx->indexes[$match]); } $this->ctx->add_index($key); }