我的schema.yml學說關係返回字符串
Organisation:
columns:
id: { type: integer(4), notnull: true, unique: true, primary: true, autoincrement: true }
name: { type: string(100), notnull: true, unique: true }
parent_organisation_id: { type: integer(4), notnull: false }
relations:
ParentOrganisation: { class: Organisation, local: parent_organisation_id, foreignAlias: ChildOrganisations }
一些組織所存儲的整數值0,沒有這樣的organisation_id。出乎我的意料,當我運行這段代碼
class organisationActions extends autoOrganisationActions{
public function executeEdit(sfWebRequest $request){
$this->organisation = $this->getRoute()->getObject();
$p = $this->organisation->getParentOrganisationId();
var_dump($p);
結果是字符串(1)「0」
爲什麼這不是返回一個整數,這樣我可以比較=== 0
嗨@jdog,你使用的環境和堆棧? PHP版本,sf版本(1.4我想......),推動還是學說? MySQL或Postgres?所以我可以複製你的問題.... – Matteo 2015-03-16 09:30:30
嗨@jdog,我的答案呢? – Matteo 2015-03-18 10:55:41
嗨@jdog有什麼消息嗎? – Matteo 2015-03-20 08:59:59