Bläddra i källkod

Command ProducerDescriptionNl2brController

feature/souke
Guillaume Bourgeois 10 månader sedan
förälder
incheckning
9cd51230eb
1 ändrade filer med 22 tillägg och 0 borttagningar
  1. +22
    -0
      console/commands/ProducerDescriptionNl2brController.php

+ 22
- 0
console/commands/ProducerDescriptionNl2brController.php Visa fil

@@ -0,0 +1,22 @@
<?php

namespace console\commands;

use common\logic\Producer\Producer\Module\ProducerModule;
use yii\console\Controller;

class ProducerDescriptionNl2brController extends Controller
{
// ./yii producer-description-nl2br/apply
public function actionApply()
{
$producerModule = ProducerModule::getInstance();

foreach($producerModule->getRepository()->findProducers() as $producer) {
$producer->description = nl2br($producer->description);
$producer->save();
}
}
}

?>

Laddar…
Avbryt
Spara