Ejemplo n.º 1
0
 public function equals(Column $otherColumn, $namesOnly = true)
 {
     if (!$this->_table->equals($otherColumn->getTable()) || $this->getName() !== $otherColumn->getName()) {
         return false;
     }
     if ($namesOnly) {
         return true;
     }
     $otherRef = $otherColumn->getReference();
     if ($this->_type !== $otherColumn->getType() || $this->_maxLength && $this->_maxLength !== $otherColumn->getMaxLength() || $this->_allowedValues != $otherColumn->getAllowedValues() || $this->_keyType !== $otherColumn->getKeyType() || $this->_autoIncreased !== $otherColumn->isAutoIncreased() || $this->_optional !== $otherColumn->isOptional() || $this->_defaultValue !== $otherColumn->getDefaultValue() || $this->_reference && !$otherRef || !$this->_reference && $otherRef || $this->_reference && $otherRef && !$this->_reference->equals($otherRef)) {
         return false;
     }
     return true;
 }