Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. <?php
  2. class BlogFilter
  3. {
  4. protected $messages = array();
  5.  
  6. public function forUpdate(BlogPost $post)
  7. {
  8. $this->messages = array();
  9.  
  10. if (! trim($post->title)) {
  11. $this->messages['title'] = 'The title must not be empty.';
  12. return false;
  13. }
  14.  
  15. return true;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement