コード例 #1
0
 /**
  * Get list of translations
  *
  * GET /api/translations/
  */
 public function indexAction()
 {
     $limit = $this->Request()->getParam('limit', 1000);
     $offset = $this->Request()->getParam('start', 0);
     $sort = $this->Request()->getParam('sort', array());
     $filter = $this->Request()->getParam('filter', array());
     $result = $this->resource->getList($offset, $limit, $filter, $sort);
     $this->View()->assign($result);
     $this->View()->assign('success', true);
 }
コード例 #2
0
 /**
  * @depends testArticleUpdateOverride
  */
 public function testArticleUpdateMerge($key)
 {
     $this->resource->setResultMode(2);
     $translation = $this->resource->getList(0, 1, array(array('property' => 'translation.type', 'value' => 'article'), array('property' => 'translation.key', 'value' => $key), array('property' => 'translation.shopId', 'value' => 2)));
     $translation = $translation['data'][0];
     $translation['data'] = array('txtArtikel' => 'Update-2');
     $updated = $this->resource->update($key, $translation);
     $this->assertEquals($translation['key'], $updated->getKey(), 'Translation key do not match');
     $this->assertEquals($translation['type'], $updated->getType(), 'Translation type do not match');
     $dataTranslation = unserialize($updated->getData());
     $this->assertEquals($translation['data']['txtArtikel'], $dataTranslation['txtArtikel']);
     $this->assertEquals('UPDATE - Dummy Translation', $dataTranslation['txtlangbeschreibung']);
 }