public function create(array $aData = [], $bReturnObject = false, \Nails\Common\Factory\Locale $oLocale = null)
    {
        /** @var Database $oDb */
        $oDb = Factory::service('Database');

        if (empty($oLocale)) {
            throw new ModelException(
                self::class . ': A locale must be defined when creating a localised item'
            );
        }

        $aData['language'] = $oLocale->getLanguage();
        $aData['region']   = $oLocale->getRegion();
        unset($aData['locale']);

        if (empty($aData[$this->tableIdColumn])) {
            $oDb->set($this->tableIdColumn, null);
            $oDb->insert(parent::getTableName());
            $aData[$this->tableIdColumn] = $oDb->insert_id();
            if (empty($aData[$this->tableIdColumn])) {
                throw new ModelException(
                    'Failed to generate parent item for localised object'
                );
            }
            $bCreatedItem = true;
        }

        /**
         * This is to prevent primary key conflicts if a previously deleted item still
         * exists in the table
         */
        if (!$this->isDestructiveDelete()) {
            $this->destroy($aData[$this->tableIdColumn], $oLocale);
        }

        /**
         * Ensure automatic slug generation takes into account locale
         */
        if ($this->isAutoSetSlugs() && empty($aData[$this->tableSlugColumn])) {
            $aData[$this->tableSlugColumn] = $this->generateSlug(
                getFromArray($this->tableLabelColumn, $aData),
                null,
                $oLocale
            );
        }

        $iItemId = parent::create($aData, false);

        if (empty($iItemId)) {
            if (!empty($bCreatedItem)) {
                $oDb->where($this->tableIdColumn, $aData[$this->tableIdColumn]);
                $oDb->delete(parent::getTableName());
            }
            return null;
        } elseif (!$bReturnObject) {
            return $iItemId;
        }

        return $this->getById($iItemId, ['USE_LOCALE' => $oLocale]);
    }