コード例 #1
0
 /**
  * @return mixed
  */
 public function actionHlxml()
 {
     Yii::$app->response->format = Response::FORMAT_RAW;
     $headers = Yii::$app->response->headers;
     $headers->add('Content-Type', 'text/xml; charset=UTF-8');
     return $this->renderPartial('hlxml', ['categories' => Category::find()->all(), 'products' => Product::findAll(['export' => true]), 'date' => ProductTranslation::find()->orderBy(['update_time' => SORT_DESC])->one()->update_time]);
 }
コード例 #2
0
ファイル: Product.php プロジェクト: worldia/textmaster-bundle
 /**
  * Add a translation.
  *
  * @param ProductTranslation $translation
  */
 public function addTranslation(ProductTranslation $translation)
 {
     $this->translations[$translation->getLocale()] = $translation;
     $translation->setTranslatable($this);
 }