<?php
// $searchResult is type of Outcome
// This is what we do:
dList::lessAnchor($searchResult)->showElement();
dList::moreAnchor($searchResult)->showElement();
/**
* @returns vAnchor (can get showed with showElement() - not part of the problem)
*/
public static function lessAnchor(Outcome $searchResult){
$searchData = $searchResult->searchData;
$searchData->Page = $searchData->Page - 1; // (!1)
return self::basicAnchor($searchData, "Back");
}
/**
* @returns vAnchor (can get showed with showElement() - not part of the problem)
*/
public static function moreAnchor(Outcome $searchResult){
$searchData=$searchResult->searchData;
$searchData->Page = $searchData->Page + 1; // (!2)
return self::basicAnchor($searchData, "More");
}
When I call dList::lessAnchor()
on $searchResult
, it modifies the property of $searchData->Page
by decreasing it by 1 as you see, marked at line with (!1)
.
After a while (one line below), I call dList::moreAnchor()
on $searchResult
again.
为什么我看<代码>Page属性在<代码>(!2)上下降1? 我没有通过<代码>查询<>。