0
私はprivate function getFullPath()
で私protected $filename
にアクセスしようとすると、私の変数は常に空で、誰でも変数の内容にアクセスするための解決策を知っているクラスはここ
class cwb extends SoapClient {
protected $raw_xml;
protected $filename;
public $users;
/**
* @param mixed $entity
*/
public function __construct($entity = '') {
parent::__construct('http://privatesite?WSDL');
$this->raw_xml = $this->createXmlFile($entity->token);
$this->filename = $this->createXmlFilename($entity->nome);
$this->users = $this->createUserArray();
}
/**
* @return string
*/
private function getFullPath(){
return (string)$this->getPath() . '/' . $this->filename;
}
}
である私のPHPクラスの変数を回復することはできません?
本当に空ですか?あなたはそれをチェックする 'var_dump($ this-> filename);'しようとしましたか? –
'var_dump($ entity);' – AbraCadaver
はい、空です。クラス定義でデフォルト値を設定すると、通常は変数にアクセスできますが、変数をコンストラクタで埋めると変数は空になります。 –