Example #1
0
 /**
  * Get the post type API
  *
  * @return mixed        Loads an existing type as a new PostType,
  *                      or returns a new PostTypeBuilder for registering a new type.
  */
 public static function postType()
 {
     return PostType::make(static::postTypeId());
 }
Example #2
0
 /**
  * Get all post types associated with this taxonomy.
  *
  * @return Collection
  */
 public function postTypes()
 {
     return Collection::make($this->object_type)->map(function ($post_type) {
         return PostType::load($post_type);
     });
 }
Example #3
0
 /**
  * @test
  */
 function it_has_readonly_magic_properties()
 {
     $type = PostType::load('post');
     $this->assertSame('post', $type->slug);
     $this->assertSame('Post', $type->one);
     $this->assertSame('Posts', $type->many);
     $this->assertNull($type->nonExistentProperty);
 }