Explorar el Código

Command ProducerDescriptionNl2brController

feature/souke
Guillaume Bourgeois hace 10 meses
padre
commit
9cd51230eb
Se han modificado 1 ficheros con 22 adiciones y 0 borrados
  1. +22
    -0
      console/commands/ProducerDescriptionNl2brController.php

+ 22
- 0
console/commands/ProducerDescriptionNl2brController.php Ver fichero

@@ -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();
}
}
}

?>

Cargando…
Cancelar
Guardar