-
-
Save hailwood/997ab612f157e70b48ee 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 Business extends DataObject { | |
//... | |
private static $has_one = array( | |
"Category" => "Category", | |
); | |
private static $has_many = array( | |
"Services" => "Service" | |
); | |
//... | |
} | |
//... | |
class Category extends DataObject { | |
//... | |
private static $has_many = array( | |
"Businesses" => "Business", | |
"Services" => "Service" | |
); | |
//... | |
} | |
//... | |
class Service extends DataObject { | |
//... | |
private static $has_one = array( | |
'Category' => 'Category' | |
); | |
private static $belongs_many_many = array( | |
"Businesses" => "Business", | |
); | |
//... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment