Available Inheritance

The methods made available through AppTaxonomy, AppModel and AppCustomPostType are also available to classes seeking representation of recurring Wordpress concepts like the Post and Page.

Strata offers predefined classes from which to inherit in order for your models to gain query and factory methods.

Category

Represents a Post category. The complete API definition for this class can be found on our Api.

1
2
3
4
5
6
7
8
9
10
11
12
<?php
namespace App\Model;

use Strata\Model\Taxonomy\Category as StrataCategory

class Category extends StrataCategory
{

    // ...

}
?>

Post

Represents a Post object. The complete API definition for this class can be found on our Api.

1
2
3
4
5
6
7
8
9
10
11
12
<?php
namespace App\Model;

use Strata\Model\Post as StrataPost

class Post extends StrataPost
{

    // ...

}
?>

It can also be applied to a custom Page object. You should then override getWordpressKey() in order for it to understand the page post type.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
namespace App\Model;

use Strata\Model\Post as StrataPost

class Page extends StrataPost
{
    public function getWordpressKey()
    {
        return "page";
    }

    // ...

}
?>

User

Represents a User object. The complete API definition for this class can be found on our Api.

1
2
3
4
5
6
7
8
9
10
11
12
<?php
namespace App\Model;

use Strata\Model\User as StrataUser

class User extends StrataUser
{

    // ...

}
?>