[英]Cannot instantiate php object
我有一個PHP接口和一個實現它的類。 當我嘗試使對象實例化時,(網頁)頁面完全變為白色,即使顯示錯誤為“開”,它也不會顯示任何錯誤,並且如果錯誤報告設置為E_ALL,則不會報告任何錯誤,也不會在php錯誤中顯示任何錯誤日志或Apache錯誤日志。
這是代碼。
<?php
namespace it\MyCompany\OtherCompany\System;
interface IInsertUserQueryStrategy{
/**
*
* @param User $u
* @param array $defaultParameters
* @param string $ua
*/
public function insert(User $u, $defaultParameters = array(), $ua = null);
}
實現它的類
<?php
namespace it\MyCompany\OtherCompany\ICF\System;
use it\MyCompany\OtherCompany\System\IInsertUserQueryStrategy;
class ICFInsertUserQueryStrategy implements IInsertUserQueryStrategy{
public function insert(ICFUser $u, $defaultParameters = array(), $ua = null){
$u->setActivationKey();
$parameters = array_merge($defaultParameters,
array (ICFUserPeer::VERIFICATION_KEY => $u->getActivationKey(),
ICFUserPeer::NOME => $u->getNome(),
ICFUserPeer::COGNOME => $u->getCognome(),
ICFUserPeer::EMAIL => $u->getEmail(),
ICFUserPeer::CELLULARE => $u->getCellulare(),
ICFUserPeer::PASSWORD => $u->getPassword(),
ICFUserPeer::PRIVACY => (int)$u->getPrivacyMarketing(),
ICFUserPeer::PDV => $u->getPuntoVendita(),
ICFUserPeer::FIDELITY => $u->getFidelity(),
ICFUserPeer::TIPOCARD => $u->getTipoCard(),
ICFUserPeer::TIPO_AZIONE => UserPeer::WS_CONSUMERHANDLER_INSERT));
if (! is_null ( $ua )) {
$parameters = array_merge ( $parameters, $ua );
}
return $parameters;
}
}
我使用composer和自動加載系統,這兩個類的同一目錄中包含的其他類/文件都被加載而沒有問題。
$is = new ICFInsertUserQueryStrategy(); //This generate some error wtih blank page
由於插入方法的定義應該相同,因此不能使用ICFUser
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.