title: PHP OOP, Uncaught Error: Call to a member function setAuthor() on string
body: <p>I use PHP version 7 and i get always this error, when i creat a news article: </p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Call to a member function setAuthor() on string in D:\xampp\htdocs\entwicklung\tools\adminlogin\lib\mod\news\newsForm.php:14 Stack trace: #0 {main} thrown in D:\xampp\htdocs\entwicklung\tools\adminlogin\lib\mod\news\newsForm.php on line 14</p>
  </blockquote>
  
  <p>Here i creat my object and would save the article in my database:</p>
  
  <pre><code>if(isset($_POST["publish"]))
  {
      $news = new News();
      $title = $news-&gt;setTitle($db, $_POST["ueberschrift"]);
      $news =  $news-&gt;setNews($db, $_POST["artikel"]);
      $author = $news-&gt;setAuthor($db, $_POST["autor"]); //This is line 14
  
      News::newsArticleCreate($db, $title, $news, $author);
  
  }
  </code></pre>
  
  <p>This is my setter-method for the author:</p>
  
  <pre><code>    function setAuthor($db, $author)
      {
          if(!empty($author))
          {
              $author = mysqli_real_escape_string($db, $author);
              return $this-&gt;author = trim($author);
          }
          else
          {
              return false;
          }
      }
  </code></pre>
  
  <p>What is my mistake?</p>