protected function generateDataFile($dir)
    {
        $file = $dir . '/' . $this->config->getClassname() . '.php';

        if (file_exists($file)) {
            return;
        }

        if (!is_readable($file) && false === file_put_contents($file, '')) {
            throw new \RuntimeException('Cannot create empty class file: ' . $file);
        }

        $content = '<?php

/**
 * Copyright (c) 2010-' . date('Y') . ' ' . $this->config->getAuthor() . '
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ' . $this->baseNamespace . 'Data\\' . $this->config->getNamespace() . ';

/**
 * DataMapper Data class for table "' . $this->config->getDbTable() . '"
 *
 * @author  ' . $this->config->getAuthor() . '
 * @version ' . $this->config->getVersion() . '
 */
class ' . $this->config->getClassname() . ' extends Abstracts\\' . $this->config->getClassname() . 'Abstract
{
}
';
        if (false === file_put_contents($file, $content)) {
            throw new \RuntimeException('Unable to write file content! (file: ' . $file . ')');
        }
    }
protected function generateDataFile($dir)
    {
        $file = $dir . '/' . $this->config->getClassname() . '.php';

        if (file_exists($file)) {
            return;
        }

        if (!is_readable($file) && false === file_put_contents($file, '')) {
            throw new \RuntimeException('Cannot create empty class file: ' . $file);
        }

        $content = '<?php

/**
 * Copyright (c) 2010-' . date('Y') . ' ' . $this->config->getAuthor() . '
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ' . $this->baseNamespace . 'Data\\' . $this->config->getNamespace() . ';

/**
 * DataMapper Data class for table "' . $this->config->getDbTable() . '"
 *
 * @author  ' . $this->config->getAuthor() . '
 * @version ' . $this->config->getVersion() . '
 */
class ' . $this->config->getClassname() . ' extends Abstracts\\' . $this->config->getClassname() . 'Abstract
{
}
';
        if (false === file_put_contents($file, $content)) {
            throw new \RuntimeException('Unable to write file content! (file: ' . $file . ')');
        }
    }
protected function generateDataFile ( $ dir ) { $ file = $ dir . '/' . $ this -> config -> getClassname ( ) . '.php' ; if ( file_exists ( $ file ) ) { return ; } if ( ! is_readable ( $ file ) && false === file_put_contents ( $ file , '' ) ) { throw new \ RuntimeException ( 'Cannot create empty class file: ' . $ file ) ; } $ content = '<?php

/**
 * Copyright (c) 2010-' . date ( 'Y' ) . ' ' . $ this -> config -> getAuthor ( ) . '
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ' . $ this -> baseNamespace . 'Data\\' . $ this -> config -> getNamespace ( ) . ';

/**
 * DataMapper Data class for table "' . $ this -> config -> getDbTable ( ) . '"
 *
 * @author  ' . $ this -> config -> getAuthor ( ) . '
 * @version ' . $ this -> config -> getVersion ( ) . '
 */
class ' . $ this -> config -> getClassname ( ) . ' extends Abstracts\\' . $ this -> config -> getClassname ( ) . 'Abstract
{
}
' ; if ( false === file_put_contents ( $ file , $ content ) ) { throw new \ RuntimeException ( 'Unable to write file content! (file: ' . $ file . ')' ) ; } }
Generate child class if not already exists.

@param  string $dir Directory for class
@return void
@throws \RuntimeException
Generate child class if not already exists .