<?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");
}
を呼び出すdList::lessAnchor()
と$searchResult
、 の行に でマークされているように、 のプロパティを$searchData->Page
1 減らして変更します(!1)
。しばらくして (下の 1 行)、もう一度電話をかけdList::moreAnchor()
ます$searchResult
。
マークPage
でアトリビュートが 1 減っているのはなぜですか? (!2)
参照渡しはしませんでし$searchResult
た。