Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ProducerDescriptionNl2brController.php 518B

12345678910111213141516171819202122
  1. <?php
  2. namespace console\commands;
  3. use domain\Producer\Producer\ProducerModule;
  4. use yii\console\Controller;
  5. class ProducerDescriptionNl2brController extends Controller
  6. {
  7. // ./yii producer-description-nl2br/apply
  8. public function actionApply()
  9. {
  10. $producerModule = ProducerModule::getInstance();
  11. foreach($producerModule->getRepository()->findProducers() as $producer) {
  12. $producer->description = nl2br($producer->description);
  13. $producer->save();
  14. }
  15. }
  16. }
  17. ?>