| 1 | <?php |
||
| 2 | |||
| 3 | namespace LeKoala\CommonExtensions; |
||
| 4 | |||
| 5 | use SilverStripe\ORM\DataExtension; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * A simple company extension for Member |
||
| 9 | * |
||
| 10 | * You might want to use a more complete company representation for situations where members can belong to multiple companies |
||
| 11 | * or if you need more details about the company |
||
| 12 | * |
||
| 13 | * @property \LeKoala\CommonExtensions\SimpleCompanyExtension $owner |
||
| 14 | * @property string $CompanyName |
||
| 15 | * @property string $VatNumber |
||
| 16 | */ |
||
| 17 | class SimpleCompanyExtension extends DataExtension |
||
| 18 | { |
||
| 19 | private static $db = [ |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 20 | "CompanyName" => "Varchar(255)", |
||
| 21 | "VatNumber" => "Varchar(255)", |
||
| 22 | ]; |
||
| 23 | |||
| 24 | public function IsIndividual() |
||
| 25 | { |
||
| 26 | return $this->owner->CompanyName == ''; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function IsCompany() |
||
| 30 | { |
||
| 31 | return $this->owner->CompanyName != ''; |
||
| 32 | } |
||
| 33 | } |
||
| 34 |