How to simplify my result in Cakephp 3

35 views Asked by At

My code is:

 $costSheetQuery = $this->CostSheets->find('all')->where(['id IN' => $criteria]);;
$costSheetData = $costSheetQuery->all();

I print the array $costSheetData and it gives me the following relust:

Cake\ORM\ResultSet Object
(
    [items] => Array
        (
            [0] => App\Model\Entity\CostSheet Object
                (
                    [id] => 5
                    [key_value] => {"sample_date":"10-03-2018","mh_sc":"mh-sc","buyer":"buyer","season":"season","style":"styel","style_detail":"Style Details","sample_img":[[""]],"fab_category":[["FABRIC CATEGORY","FABRIC CATEGORY","FABRIC CATEGORY","FABRIC CATEGORY","FABRIC CATEGORY","FABRIC CATEGORY"]],"patt":[["PATT","PATT","PATT","PATT","PATT","PATT"]],"size":[["SIZE","SIZE","SIZE","SIZE","SIZE","SIZE"]],"ship_date":[[{"year":"2018"},{"month":"01"},{"day":"01"}]],"piece":[["10","20","30","40","50","60"]],"fabric_usage":[["USAGE"]],"fabric_yds":[["yds"]],"fabric_body":[["Body","Body","Body","Body","Body","Body"]],"cm":[["embrotery"]],"cm_value":[["     10     ","12.00","","15","",""]],"trims":[["thread"]],"trims_value":[["10","","10","20","",""]]}
                    [created] => Cake\I18n\FrozenTime Object
                        (
                            [time] => 2018-03-10T16:47:52+00:00
                            [timezone] => UTC
                            [fixedNowTime] => 
                        )

                    [modified] => Cake\I18n\FrozenTime Object
                        (
                            [time] => 2018-03-10T16:47:52+00:00
                            [timezone] => UTC
                            [fixedNowTime] => 
                        )

                    [[new]] => 
                    [[accessible]] => Array
                        (
                            [key_value] => 1
                            [created] => 1
                            [modified] => 1
                        )

                    [[dirty]] => Array
                        (
                        )

                    [[original]] => Array
                        (
                        )

                    [[virtual]] => Array
                        (
                        )

                    [[errors]] => Array
                        (
                        )

                    [[invalid]] => Array
                        (
                        )

                    [[repository]] => CostSheets
                )

        )

)

Whats hell is going on. I just start hating cakephp. My additional bullshit in my array? I also try to separate as : $items->costSheetData as item is an object of $costSheetData. But it gives me an arrow. Any idea?

0

There are 0 answers