Skip to content

Commit

Permalink
✨ Added isDraft() helper to ViewFileTrait for #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Dann committed Jan 5, 2017
1 parent 81782fc commit 46a0305
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Entities/ViewFileTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,14 @@ public function hasPreviousNext()

return true;
}

/**
* Returns true if the File has draft front matter set to true
*
* @return bool
*/
public function isDraft()
{
return boolval($this->getData('draft', false));
}
}

0 comments on commit 46a0305

Please sign in to comment.