moduleDataSetup = $moduleDataSetup; $this->authorFactory = $authorFactory; $this->date = $date; } /** * Do Upgrade * * @return void */ public function apply() { $defaultData = [ 'name' => 'Admin', 'type' => 0, 'status' => 1, 'created_at' => $this->date->date() ]; if (!$this->authorFactory->create()->getCollection()->getSize()) { $this->moduleDataSetup->getConnection()->insertOnDuplicate( $this->moduleDataSetup->getTable('mageplaza_blog_author'), $defaultData ); } } /** * @inheritdoc */ public function revert() { } /** * @inheritdoc */ public function getAliases() { return []; } /** * @inheritdoc */ public static function getDependencies() { return []; } }