i have two myISAM tables:ex1 ex2. each table have two Field.They are id1,t1(ex1) ; id2,t2(ex2); how to use hasone method that it can be the same as this SQL:
select ex1.*,ex2.* from ex1 inner join ex2 where ex1.id1=ex2.id2;
model:
//model ex1.php
namespace Frontend\Model;
class ex1 extends \Phalcon\Mvc\Model{
public initialize(){
$this->hasone( 'id1' , 'Model\ex2' , 'id2' , array( 'alias' => ‘ex2’) );
}
}
controller:
//controller indexController.php
namespace Frontend\Controller;
use \Frontend\Model\ex1;
class indexController extends Phalcon\Mvc\Controller{
public indexAction(){
$result = ex1::find() -> toArray();
var_dump( $result );
}
}
OS: win8.1 64 Nginx:1.8.1 PHP:php-5.4.45-nts-Win32-VC9-x86 Phalcon:2.1.0r
The result is : only ex1 data can be displayed. how to fix it? Thanks for your help.