Hi all,
Here is the problem:
Model A:
namespace Testing\Models;
class A extends \Phalcon\Mvc\Model
{
public function initialize()
{
$this->belongsTo("b_id", "B", "id");
}
}
Model B:
namespace Testing\Models;
class B extends \Phalcon\Mvc\Model
{
public function initialize()
{
$this->hasMany("id", "A", "b_id");
}
}
Controller A:
use Testing\Models\A;
use Testing\Models\B;
class AController extents ControllerBase
{
public someAction()
{
$a = A::findFirst(1);
echo $a->B->oneField;
}
}
Screen print out: Model 'B' could not be loaded.