开发者

Weird baffling Zend/Doctrine error on new className() for simple class

I'm baffled and hoping that somebody here has a clue.

I think I have Doctrine 1.x with Zend.

I've created a fairly simple record type:

class MYAPP_Model_CustomerContactRequest extends Doctrine_Record
{
    /**
     * Set table definition
     */
    public function setTableDefinition()
    {
    $this->setTableName('my_table_name');
    $this->hasColumn('id', 'integer', 4, array(
         'type' => 'integer',
         'length' => 4,
         'unsigned' => 0,
         'primary' => true,
         'autoincrement' => true,
         ));
    $this->hasColumn('customerEmail', 'string', 255, array(
         'type' => 'string',
         'length' => 255,开发者_如何学Python
         'fixed' => false,
         'primary' => false,
         'notnull' => true,
         'autoincrement' => false,
         ));
    $this->hasColumn('vendorID',  'integer', 4, array(
         'type' => 'integer',
         'length' => 4,
         'unsigned' => 0,
         'primary' => false,
         'notnull' => true,
         'autoincrement' => false,
         ));
    $this->hasColumn('contactStatus',  'integer', 4, array(
         'type' => 'integer',
         'length' => 4,
         'unsigned' => 0,
         'primary' => false,
         'autoincrement' => false,
         ));
    }
    Other member funcs ...
}

Not much to it.

I have a form that sends in the vendorID and customerEmail data. No big deal.

The submit action in the controller is correctly triggered on the button press. OK.

But the submit action is crashing and giving me the white screen of death without even an error message. I'm pretty confused at this point.

The submit action reads:

    public function submitAction(){

    try {
        $request = new MYAPP_Model_CustomerContactRequest();
    }
    catch (Zend_Exception $e) {
        echo "Caught exception: " . get_class($e) . "\n";
        echo "Message: " . $e->getMessage() . "\n";
    }

    /*
    $request = new MYAPP_Model_CustomerContactRequest();
    $request->customerEmail = $_GET['custEmail'];
    $request->vendorID =$this->_targetExpertID;
    $request->contactStatus = 1;
    $request->save();
    */
}

As you can see, I've commented out the actual record save and I'm simply trying to instantiate the model class.

I must be missing something either glaringly obvious or really dark and mysterious. There doesn't seem to be enough here to cause an error.

Removing the statement: $request = new Knowbees_Model_CustomerContactRequest(); ... from the try clause makes no difference.

If I comment out the instantiation, I proceed through to the response page as if all were well.

Does this suggest ANYTHING to you? I'm stumped.


!#!@$@!$#@ !!!

It was a path problem!

I had the !@#!@# file CustomerContactRequest.php in the path:

BASE_DIR\application\modules\MYAPP\models\CustomerContactRequest\CustomerContactRequest.php

... instead of

BASE_DIR\application\modules\MYAPP\models\CustomerContactRequest.php

.
And the @#!$@!$ class name ...

MYAPP_Model_CustomerContactRequest

... implies that the definition is right under the models directory!

Once I moved the file, the whole stupid thing sprang to life.

=======

I deeply resent not having received an error message from the loader! This glaringly obvious idiot error seriously cut into my drinking time tonight.

Hope this post helps somebody else someday.

@#@$#@$#$# !!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜