예제 #1
0
 /**
  * Store data to the appropriate table
  *
  * @param   array            $data        Data to be stored
  * @param   JTableInterface  $table       JTable Object
  * @param   boolean          $primaryKey  Flag that is true for data that are using #__ucm_content as their primary table
  *
  * @return  boolean  true on success
  *
  * @since   3.1
  */
 protected function store($data, JTableInterface $table = null, $primaryKey = null)
 {
     $table = $table ? $table : JTable::getInstance('Corecontent');
     $typeId = $this->getType()->type->type_id;
     $primaryKey = $primaryKey ? $primaryKey : $this->getPrimaryKey($typeId, $data['core_content_item_id']);
     if (!$primaryKey) {
         // Store the core UCM mappings
         $baseData = array();
         $baseData['ucm_type_id'] = $typeId;
         $baseData['ucm_item_id'] = $data['core_content_item_id'];
         $baseData['ucm_language_id'] = JHelperContent::getLanguageId($data['core_language']);
         if (parent::store($baseData)) {
             $primaryKey = $this->getPrimaryKey($typeId, $data['core_content_item_id']);
         }
     }
     return parent::store($data, $table, $primaryKey);
 }
예제 #2
0
 /**
  * Tests the getType() method
  *
  * @return  void
  *
  * @since   3.2
  */
 public function testGetType()
 {
     $this->assertEquals($this->object->getType()->type->type_title, 'Article', 'The type title for com_content.article is Article.');
 }