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