How to create a new Entry model in Craft 3?
Just so there's an answer here. OP was using Craft 2 code in a Craft 3 environment.

The code should be something like this in Craft 3:

$entry = new Entry();
$entry-&gt;sectionId = $yourSectionId;
$entry-&gt;typeId = $yourEntryTypeId;
$entry-&gt;authorId = $yourAuthorId;
$entry-&gt;enabled = true;
$entry-&gt;title = "Foo";
$entry-&gt;setFieldValues([
    'field1' =&gt; "Foo",
    'field2' =&gt; "Bar",
]);
$success = Craft::$app-&gt;elements-&gt;saveElement($entry);
if (!$success) {
    Craft::error('Couldn’t save the entry "'.$entry-&gt;title.'"', __METHOD__);
}