public function init(Table &$table) {
        $this->_table = & $table;
        $className = str_replace('\\', '.', get_called_class());
        $path = DATA . 'mapper' . DIRECTORY_SEPARATOR . $className;
        $save = false;

        @session_start();
        if (@$_SESSION['mapperSave'] && !is_readable($path)) {
            $this->save($path, $this->getClassSettings());
            unset($_SESSION['mapperSave']);
        }

        if (!$this->tableExists($table)) {
            $save = $this->createTable($table);
        }
        else {
            $this->checkModelRequirements();
            $save = $this->isUpToDate($path, $table);
        }

        if ($save || !is_readable($path))
            $this->save($path, $this->getClassSettings());
    }
public function init(Table &$table) {
        $this->_table = & $table;
        $className = str_replace('\\', '.', get_called_class());
        $path = DATA . 'mapper' . DIRECTORY_SEPARATOR . $className;
        $save = false;

        @session_start();
        if (@$_SESSION['mapperSave'] && !is_readable($path)) {
            $this->save($path, $this->getClassSettings());
            unset($_SESSION['mapperSave']);
        }

        if (!$this->tableExists($table)) {
            $save = $this->createTable($table);
        }
        else {
            $this->checkModelRequirements();
            $save = $this->isUpToDate($path, $table);
        }

        if ($save || !is_readable($path))
            $this->save($path, $this->getClassSettings());
    }
public function init ( Table & $ table ) { $ this -> _table = & $ table ; $ className = str_replace ( '\\' , '.' , get_called_class ( ) ) ; $ path = DATA . 'mapper' . DIRECTORY_SEPARATOR . $ className ; $ save = false ; @ session_start ( ) ; if ( @ $ _SESSION [ 'mapperSave' ] && ! is_readable ( $ path ) ) { $ this -> save ( $ path , $ this -> getClassSettings ( ) ) ; unset ( $ _SESSION [ 'mapperSave' ] ) ; } if ( ! $ this -> tableExists ( $ table ) ) { $ save = $ this -> createTable ( $ table ) ; } else { $ this -> checkModelRequirements ( ) ; $ save = $ this -> isUpToDate ( $ path , $ table ) ; } if ( $ save || ! is_readable ( $ path ) ) $ this -> save ( $ path , $ this -> getClassSettings ( ) ) ; }
Initialize the row
@param Table $table Live table connection
Initialize the row