yii2-extended/yii2-export-policy-datetime

An implementation of the yii2 export policy interface that creates files for each models and one of their date field values

7.0.7 2024-12-08 14:10 UTC

README

An implementation of the yii2 export policy interface that creates files for each models and one of their date field values.

coverage build status

Installation

The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.

  • Download composer.phar from their website.
  • Then run the following command to install this library as dependency :
  • php composer.phar yii2-extended/yii2-export-policy-datetime ^7

Basic Usage

This library may be used the following way :


use Yii2Extended\Yii2Export;

$policy = new Yii2ExportPolicyMonth($folderPath, Record::find(), 'date_field');

foreach($policy as $activeQuery)
{
	/* @var $activeQuery \yii\db\ActiveQuery[Record] */
	file_put_contents($policy->getCurrentFilePath().'.txt', var_export($activeQuery->all(), true));
}

License

MIT (See license file).