Bolt\Legacy\Storage::getEmptyContent PHP Method

getEmptyContent() public method

public getEmptyContent ( $contenttypeslug )
    public function getEmptyContent($contenttypeslug)
    {
        $content = $this->getContentObject($contenttypeslug);
        // don't use 'undefined contenttype' as title/name
        $content->setValues(['name' => '', 'title' => '']);
        return $content;
    }

Usage Example

Example #1
0
 public function testGetEmptyContent()
 {
     $app = $this->getApp();
     $storage = new Storage($app);
     $showcase = $storage->getEmptyContent('showcase');
     $this->assertInstanceOf('Bolt\\Legacy\\Content', $showcase);
     $this->assertEquals('showcases', $showcase->contenttype['slug']);
 }