Jump to content

Recommended Posts

Hi,

I am using Zend 1.8. I have two tables, one parent and one dependant. The inferential integrity is defined at the table level.

 

I do a couple of select and everything works fine. When I try to get the dependantrowset however, I get an error. In the 'findDependentRowset' method, I'm supposed to tell it the name of the class of the dependant table. The name of that class is Model_DbTable_CostTreePath and it's in the Models folder in my structure. I get an error message in the logs saying:

include(CostTreePath.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /Library/WebServer/Documents/Zend/library/Zend/Loader.php on line 83

 

I know it's trying to find the file corresponding to the class of my dependant table. I'm not quite sure how to do this however. Can anyone shed some light on this?

 

Thanks in advance.

 

here's the relevant extract of my code: ( I don't need to declare dependant table as I do that at the database level)

Parent table:

class Model_DbTable_Tree extends Zend_Db_Table_Abstract 
{ 
    protected $_schema = 'test-company'; //Implementer registry et aller chercher le nom de la db pour chaque compagnie dans le registry
    protected $_name   = 'tree';
    protected $_primary = 'node_id';
    protected $_sequence = true;
......

dependant table:

class Model_DbTable_CostTreePath extends Zend_Db_Table_Abstract 
{ 
    protected $_schema = 'test-company'; //Implementer registry et aller chercher le nom de la db pour chaque compagnie dans le registry
    protected $_name   = 'CostTreePath';
    protected $_primary = array('ancestor_id','descendant_id');
protected $_referenceMap = array(
        'Ancestor' => array(
            'columns'           => 'ancestor_id',
            'refTableClass'     => 'tree',
            'refColumns'        => 'node_id'
        ),
        'Descendant' => array(
            'columns'           => 'descendant_id',
            'refTableClass'     => 'tree',
            'refColumns'        => 'node_id'
        ),
    );
........

 

The dependant table's model's controller:

<?php

class CostTreePathController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $this->view->title = "Budget Objects - TreePath view"; 
        $this->view->headTitle($this->view->title, 'PREPEND'); 

        $tree = new Model_DbTable_Tree(); 
	$Rowsetnew = $tree->find(5);
	$Row1 = $Rowsetnew->current();
	$relatedRows = $Row1->findDependentRowset('Model_DbTable_CostTreePath', 'Ancestor');
        $this->view->treePath = $treepath;
    }
}

Link to comment
https://forums.phpfreaks.com/topic/161495-find-dependant-rowset-not-working/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.