Esempio n. 1
0
	private function spilloverChosenAffiliate(Pap_Common_User $child, Pap_Common_User $originalParentUser) {
		$user = $this->userTree->getChosenUser(Gpf_Settings::get(Pap_Settings::MATRIX_AFFILIATE));
		if ($user === null) {
			$child->setParentUserId(self::NONE_PARENT_USER_ID);
			return;
		}
		$this->initLimit($this->matrixWidth);
		$parent = $this->getParent(array($user));
		if ($parent === null) {
			$parent = $this->getParentSpillover($user);
			if ($parent === null) {
				$child->setParentUserId($user->getId());
				return;
			}
		}
		$child->setParentUserId($parent->getId());
	}