0
好的下午大家,我會直接指向這一點。我有這樣的代碼在我的模型:在zend模式中使用級聯刪除時運行函數
protected $_referenceMap = Array (
"Imagens" => Array(
"columns" => Array (
'paiId'
),
"refTableClass" => "ModeloImagem",
"refColumns" => Array(
"id"
),
"onDelete" => self::CASCADE
)
);
我要刪除這回事級聯被稱爲表中的圖像,所以我想知道是否有這樣的:
protected $_referenceMap = Array (
"Imagens" => Array(
"columns" => Array (
'paiId'
),
"refTableClass" => "ModeloImagem",
"refColumns" => Array(
"id"
),
"onDelete" => function() {
foreach($image as $i) {
unlink($i);
}
return self::CASCADE
}
)
);