if ($article->metadata->published->getTimestamp() != $item->published->date->getTimestamp()) { $article->metadata->published = $item->published->date; $update = true; } if ($update) { if (!$article->guid) { $article->create(); continue; } $article->update(); }