<?php namespace console\commands; use domain\Producer\Producer\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(); } } } ?>