<?php

class ccc_set_ralation_run extends crud_callback_chunk_run
{
    public function get_callback_string()
    {
        
        return '$this->crud->set_relation(\'' . $this->field . '\', \'' . str_replace('id_', '', $this->field) . '\', \'name\');';
    }
}

class ccc_set_ralation implements crud_callback_chunk
{

    public function get_name()
    {
        return 'Relation 1:n';
    }

    public function get_options()
    {
        return new crud_callback_chunk_options();
    }

    public function get_schema()
    {
        return 'int(11)';
    }

    public function run()
    {
        return new ccc_set_ralation_run();
    }

}
