CAFPE Docs
  • Class

Classes

  • Article_model
  • Articles
  • Auth
  • Auth_controller
  • Bcrypt
  • Hierarchical_controllers
  • Ion_auth
  • Ion_auth_model
  • MY_Controller
  • MY_Lang
  • MY_Model
  • Pages
  • Private_pages
  • Public_controller
  • Seeder
  • Slug
  • User_sessions
  • Users

Functions

  • action_result
  • actions_widget
  • admin_area_buttons
  • base64_current_url_encode
  • base64_url_decode
  • base64_url_encode
  • current_lang
  • jscript_tag
  • lang_switcher
  • logged_in
  • redirect_lang
  • site_url_lang
  • style_tag
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 
<?php
/**
 * Part of ci-phpunit-test
 *
 * @author     Kenji Suzuki <https://github.com/kenjis>
 * @license    MIT License
 * @copyright  2015 Kenji Suzuki
 * @link       https://github.com/kenjis/ci-phpunit-test
 */
class Seeder
{
    private $CI;
    protected $db;
    protected $dbforge;
    protected $seedPath;
    public function __construct()
    {
        $this->CI =& get_instance();
        $this->CI->load->database();
        $this->CI->load->dbforge();
        $this->db = $this->CI->db;
        $this->dbforge = $this->CI->dbforge;
    }
    /**
     * Run another seeder
     *
     * @param string $seeder Seeder classname
     */
    public function call($seeder)
    {
        if ($this->seedPath === null) {
            $this->seedPath = APPPATH . 'database/seeds/';
        }
        $file = $this->seedPath . $seeder . '.php';
        require_once $file;
        $obj = new $seeder;
        $obj->run();
    }
    /**
     * Set path for seeder files
     *
     * @param string $path
     */
    public function setPath($path)
    {
        $this->seedPath = rtrim($path, '/').'/';
    }
    public function __get($property)
    {
        return $this->CI->$property;
    }
}
CAFPE Docs API documentation generated by ApiGen