public function getIncompleteOrder()
    {
        if (!\Yii::$app->user->isGuest) {
            $user = User::findOne(\Yii::$app->user->id);
            $order = Order::find()
                ->where(['user_id' => $user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])
                ->one();
            if (!empty($order)) {
                return $order;
            }
        }
        return null;
    }
public function getIncompleteOrder()
    {
        if (!\Yii::$app->user->isGuest) {
            $user = User::findOne(\Yii::$app->user->id);
            $order = Order::find()
                ->where(['user_id' => $user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])
                ->one();
            if (!empty($order)) {
                return $order;
            }
        }
        return null;
    }
public function getIncompleteOrder ( ) { if ( ! \ Yii :: $ app -> user -> isGuest ) { $ user = User :: findOne ( \ Yii :: $ app -> user -> id ) ; $ order = Order :: find ( ) -> where ( [ 'user_id' => $ user -> id , 'status' => OrderStatus :: STATUS_INCOMPLETE ] ) -> one ( ) ; if ( ! empty ( $ order ) ) { return $ order ; } } return null ; }
Gets registered user's incomplete order
@return array|Order|null
Gets registered user s incomplete order