src/sb/Gitlab/Project.php
public static function fromObject($object){
        $issue = new \sb\Gitlab\P();
        foreach(get_object_vars($object) as $k=>$v){
           
            switch($k){
                case 'assignee':
                case 'author':
                    if(!is_object($v)){
                        $issue->{$k} = $v;
                        break;
                    }
                    $user = new \sb\Gitlab\User();
                    foreach(get_object_vars($v) as $uk=>$uv){
                        $user->{$uk} = $uv;
                    }
                    $issue->{$k} = $user;
                    break;

                default:
                    $issue->{$k} = $v;
            }
                
        }
        
        return $issue;
    }
public static function fromObject($object){
        $issue = new \sb\Gitlab\P();
        foreach(get_object_vars($object) as $k=>$v){
           
            switch($k){
                case 'assignee':
                case 'author':
                    if(!is_object($v)){
                        $issue->{$k} = $v;
                        break;
                    }
                    $user = new \sb\Gitlab\User();
                    foreach(get_object_vars($v) as $uk=>$uv){
                        $user->{$uk} = $uv;
                    }
                    $issue->{$k} = $user;
                    break;

                default:
                    $issue->{$k} = $v;
            }
                
        }
        
        return $issue;
    }
public static function fromObject ( $ object ) { $ issue = new \ sb \ Gitlab \ P ( ) ; foreach ( get_object_vars ( $ object ) as $ k => $ v ) { switch ( $ k ) { case 'assignee' : case 'author' : if ( ! is_object ( $ v ) ) { $ issue -> { $ k } = $ v ; break ; } $ user = new \ sb \ Gitlab \ User ( ) ; foreach ( get_object_vars ( $ v ) as $ uk => $ uv ) { $ user -> { $ uk } = $ uv ; } $ issue -> { $ k } = $ user ; break ; default : $ issue -> { $ k } = $ v ; } } return $ issue ; }
Convert stdClass Object to actual \sb\Gitlab\Issue
@param \stdClass $object
@return \sb\Gitlab\Issue
Convert stdClass Object to actual \ sb \ Gitlab \ Issue