I'm a bit confused about the usage of these two. Let's say I want to create a new entry from a controller. For me, the nicer option would be to user something like this:
$entry = new EntryModel();
$entry->sectionId = 4;
$entry->typeId = 4;
$entry->setContent([
'foo' => 'bar',
'xyz' => '456',
]);
craft()->entries->saveEntry($entry);
Somehow this is not working for me. Instead, I have to use the uglier version like this:
$entry = new EntryModel();
$entry->sectionId = 4;
$entry->typeId = 4;
$entry->getContent()->foo = 'bar';
$entry->getContent()->xyz = '123';
craft()->entries->saveEntry($entry);
Any ideas why the first example might be failing? Especially when working with more than two attributes, the first example would be way more easy to handle.