Skip to content
Permalink
Browse files

Added a check to name setter.

  • Loading branch information...
robertpustulka committed Feb 3, 2017
1 parent 7c7f32c commit 50545353eaddd2ac1fde87eb4c4ea732db641134
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/ORM/Association.php
@@ -244,6 +244,13 @@ public function __construct($alias, array $options = [])
*/
public function setName($name)
{
if ($this->_targetTable !== null) {
$alias = $this->_targetTable->getAlias();
if ($alias !== $name) {
throw new InvalidArgumentException('Association name does not match target table alias.');
}
}
$this->_name = $name;
return $this;

0 comments on commit 5054535

Please sign in to comment.
You can’t perform that action at this time.