なぜ私の check_multi 関数が -- を返すのか誰にもわかりますか?
致命的なエラー: 21 行目の /var/www/vhosts/aero.onelinksoftware.com/application/models/Design.php の未定義関数 check_multi() の呼び出し
上記のエラーが表示され、何が間違っているのかわかりません。関数をパブリック、プライベート、静的、およびその他の組み合わせとして設定しようとしましたが、何を試しても; システムはまだエラーになります。Zend のモデル内で関数を呼び出すことはできませんか? 自分で作成した関数が、自分で作成したクラス内にある場合に使用できない理由がわかりません。
check_multi 呼び出しの前にエコーして死亡した場合。テキストなどを見ることができます。構文のphpテストも実行しましたが、報告されている限り有効です。
class Model_Design
{
/**
* Constructs our partials.
*
* @return void
*/
public function __construct($key)
{
// Get the DB Connection
$db = Zend_Registry::Get('db');
// Setup the SQL Statement
$sql = $db->select()->from('design', array('id'));
// Get the Result
$result = $sql->query();
// Get our Row
$row = $result->fetchAll();
if(check_multi($key, $row)) {
echo "omg"; die();
}
// Make sure the id isn't empty
if (empty($key)) {
throw new Exception('You have a disturbing lack of variables.');
}
// Store the id
$this->variables = $key;
// Construct our query
$sql = $db->select()->from('design')->where('`id` = ?', $key);
// Get the result
//$result = $sql->query();
//$row = $result->fetch();
}
private function check_multi($n, $arr)
{
foreach ($arr as $key => $val) {
if ($n===$key) {
return $key;
}
}
return false;
}
}