Location: PHPKode > projects > Agile Toolkit > atk4-atk4-addons-5a69383/dynamic_model/lib/Controller/ModelDumper.php
namespace dynamic_model;
 * This class will read your model structure one model at a time and will store the data inside a PHP file.
 * Unlike database dump, this model relies on on models only and therefore would work across any  Data source.
class Controller_ModelDumper extends \AbstractController {

    public $models_backed_up=array();

    public $file=null;

    function _dump($model){

        if($this->models_backed_up[get_class($model)]++)return true;

        $this->ln('// Dumping '.$cnt.' items from model '.get_class($model));

        // Next, check the references

        foreach($model as $row){


    function classof($m){
        return get_class($m);

    function ln($line=''){
        if($this->file)return fputs($this->file,"        ".$line."\n");
        echo("        ".$line."\n");

    function dump($file=null){

Return current item: Agile Toolkit