Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Chaining ? #136

Open
navotera opened this issue Oct 27, 2020 · 0 comments
Open

Multiple Chaining ? #136

navotera opened this issue Oct 27, 2020 · 0 comments

Comments

@navotera
Copy link

navotera commented Oct 27, 2020

Hi

How to use multiple chaining when using filter function :

This is not work :

class RatihAnggaranORM extends ORM_Model
{
 public static function fSumber_dana($orm, $sumber_dana_id = false)
    {
        return ($sumber_dana_id) ?  $orm->where('sumber_dana_id', $sumber_dana_id) : $orm;
    }
    public static function fStatus($orm, $status = false)
    {
        return ($status) ?  $orm->where('status', $status) : $orm;
    }
    /** END Filter **/


   public  static function bySumberDana($sumber_dana_id = false)
    {
        return self::filter('fSumber_dana', $sumber_dana_id);
    }

    public static  function byStatus($status = false)
    {
        return self::filter('fStatus', $status);
    }
      //this will return ERROR that second chaining is not available. 
	$query = RatihAnggaranORM::byStatus()->bySumberDana();
	var_dump($query);

Thank you for any insights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant