Add model: client
This commit is contained in:
parent
945362d5e2
commit
b66dca7713
1 changed files with 18 additions and 0 deletions
18
public/site/models/client.php
Normal file
18
public/site/models/client.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
class ClientPage extends Page {
|
||||
public function projects() {
|
||||
return page('projects')->children()->filterBy('intendedTemplate', 'project')->filterBy(function($project) {
|
||||
return $project->client()->toPage() === $this;
|
||||
});
|
||||
}
|
||||
public function projectsListed() {
|
||||
return page('projects')->children()->listed()->filterBy('intendedTemplate', 'project')->filterBy(function($project) {
|
||||
return $project->client()->toPage() === $this;
|
||||
});
|
||||
}
|
||||
public function projectsUnlisted() {
|
||||
return page('projects')->children()->unlisted()->filterBy('intendedTemplate', 'project')->filterBy(function($project) {
|
||||
return $project->client()->toPage() === $this;
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue