as in phalcon, obtain only the table



  • Repatriation of results by model When you find First(s) direct copy of the class involved (when returned) (d) The method is returned to Phalcon\Mvc\Model\Resultset\Simple. This facility includes the entire operation, such as bypass, search Definite records, counting, etc.

    I do that.

     $feedback = FeedBack::find();
     foreach ($feedback as $item) {        
            $temp[] = $item;
        }
    $json = json_encode($temp);
    

    If I have to use this data set any further. I do that.

    $obj = json_decode($json);
    

    Sometimes it's just a list.

    foreach ($feedback as $item) {        
                $temp['id'] = $item->id;
                $temp['name'] = $item->name;
            }
    


  • FeedBack::find()->toArray()
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2