/**
  * Fetch a variant of a single record by id.
  *
  * @param GeneralDataConfigDefault $objConfig
  *
  * @return InterfaceGeneralModel
  */
 public function createVariant(GeneralDataConfigDefault $objConfig)
 {
     $objItem = $this->objMetaModel->findById($objConfig->getId())->varCopy();
     if (!$objItem) {
         return null;
     }
     return new GeneralModelMetaModel($objItem);
 }
 /**
  * Check if the item is published.
  * 
  * @param IMetaModel $objMetaModel Current metamodels.
  * @param int        $intItemId    Id of the item.
  * 
  * @return boolean True => Published | False => Not published
  */
 protected function isPublishedItem($objMetaModel, $intItemId)
 {
     // Check publish state of an item.
     $objAttrCheckPublish = Database::getInstance()->prepare('SELECT colname FROM tl_metamodel_attribute WHERE pid=? AND check_publish=1')->limit(1)->execute($objMetaModel->get('id'));
     if ($objAttrCheckPublish->numRows > 0) {
         $objItem = $objMetaModel->findById($intItemId);
         if (!$objItem->get($objAttrCheckPublish->colname)) {
             return false;
         }
     }
     return true;
 }