コードは次のとおりです。
<?php
class Order extends Zend_Db_Table_Abstract
{
protected $_name = 'orders';
protected $_limit = 200;
protected $_authorised = false;
public function setLimit($limit)
{
$this->_limit = $limit;
}
public function setAuthorised($auth)
{
$this->_authorised = (bool) $auth;
}
public function insert(array $data)
{
if ($data['amount'] > $this->_limit
&& $this->_authorised === false) {
throw new Exception('Unauthorised transaction of greater than '
. $this->_limit . ' units');
}
return parent::insert($data);
}
}
メソッド insert() では、何をしparent::insert($data)
ますか? それは自分自身を呼んでいますか?なぜそれをするのでしょうか?IF 条件に関係なく、return ステートメントが実行されるのはなぜですか?