在 class 中找不到字段

Field not found in class

我正在尝试将用户可用性与函数内的组相匹配。

问题是我不知道如何将模型 (getAllAvailability) 调用到数组中,以便我可以根据组 table 检查它。我可能做错了。

这是我能得到的最接近的,但在线:

foreach($this->availability as $key => $value) 

找不到空房:(

这是我的完整代码:

public function find()
    {


        /**Find groups that are not closed and send to group_find page */
        array('availability' => AvailabilityModel::getAllAvailability());
        foreach($this->availability as $key => $value) {
            GroupModel::getMatchingGroup($value->hour);

            if ($value->hour == 1600){

                /**Redirect::to('group_add user to group and check for max group size'); */
                Redirect::to('group/group_find');
            }

var_dump()

之后
array(3) { [0]=> object(stdClass)#8 (4) { ["user_id"]=> string(1) "2"
["availability_id"]=> string(1) "8" ["day"]=> string(1) "1" ["hour"]=> 
string(4) "1200" } [1]=> object(stdClass)#9 (4) { ["user_id"]=> 
string(1) "2" ["availability_id"]=> string(1) "9" ["day"]=> string(1) 
"3" ["hour"]=> string(4) "1800" } [2]=> object(stdClass)#10 (4) { 
["user_id"]=> string(1) "2" ["availability_id"]=> string(2) "10" 
["day"]=> string(1) "3" ["hour"]=> string(4) "1600" } }

@SaidKholov - 哇,我明白了。我不知道我已经为此工作了多久,直到我寻求一些帮助,我才弄明白了。我在考虑你的 var_dump 并且我意识到我试图将结果变成一个数组,当它们已经是一个数组时。
所以摆脱 make array 行,我有:

/**Find groups that are not closed and send to group_find page */
        foreach(NewguyModel::getAllAvailability() as $key => $value) {
            GroupModel::getMatchingGroup($value->hour);
        }if ($value->hour == 1600){

                /**Redirect::to('group_add user to group and check for max group size'); */
                Redirect::to('note');
            }