How to validate entry in Craft 3 An entry could be validated by the following code in craft 2:

craft()-&gt;content-&gt;validateContent($entry);


How could be the same done in Craft 3 ?
Every model has a validate() function

// set the scenario to live
$entry-&gt;setScenario(Element::SCENARIO_LIVE);

// validate the model
$entry-&gt;validate();

// get the errors,
$errors = $entry-&gt;getErrors();