Last active
January 15, 2019 18:08
-
-
Save DavidGarciaCat/57eef185b8d67b02e7cb00b4a8f3cbda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class County | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* @ORM\Column(type="integer") | |
*/ | |
private $id; | |
/** | |
* @ORM\ManyToOne(targetEntity="State", inversedBy="counties") | |
*/ | |
private $state; | |
/** | |
* @return State | |
*/ | |
public function getState(): State | |
{ | |
return $this->state; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class State | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* @ORM\Column(type="integer") | |
*/ | |
private $id; | |
/** | |
* @ORM\OneToMany(targetEntity="County", mappedBy="state") | |
*/ | |
private $counties; | |
/** | |
* @return County[]|Collection | |
*/ | |
public function getCounties() | |
{ | |
return $this->counties; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment