Created
October 19, 2017 22:36
-
-
Save VictorFursa/a25f22cb766c821b9e76765525705bd8 to your computer and use it in GitHub Desktop.
create arrayObject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Booked extends \yii\db\ActiveRecord | |
{ | |
/** @var $sum integer */ | |
public $sum; | |
/** @var $countBookedRoom integer */ | |
public $countBookedRoom; | |
/** @var $countPayment integer */ | |
public $countPayment; | |
/** @var $numberRoom integer */ | |
public $numberRoom; | |
... | |
public function foo(): array | |
{ | |
$arrayObject = []; | |
foreach ($array as $value) { | |
// Doing something | |
... | |
$reports = new Booked(); | |
$reports->sum = $sum; | |
$reports->countBookedRoom = $countBookedRoom; | |
$reports->countPayment = $countPayment; | |
$reports->numberRoom = $booked->room->number_room; | |
$arrayObject[] = $reports; | |
} | |
return $arrayObject; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment