At first,thanks for reply :)
I found out I can access by ths way
if( count($nowsale) > 0 ){
$sale = $nowsale[0];
.....
}
So I think the keypoint is it's transfer to another class form \Phalcon\Mvc\Model\Resultset\Simple to something maybe?
But the $nowsale[0] still keep object type like..
object(Pkerp\Models\Sale)[406]
public 'saleId' => string '58' (length=2)
public 'CustomerId' => string '1' (length=1)
public 'type' => string '0' (length=1)
public 'formatpath' => null
public 'showname' => string '陳建中問貨紀錄表' (length=24)
public 'totalPrice' => string '0.00' (length=4)
public 'totalGoods' => string '1' (length=1)
public 'numorder' => string '1040719SR007' (length=12)
public 'showdate' => string '2015-07-20' (length=10)
public 'comments' => null
public 'payway' => string 'month' (length=5)
public 'paydate' => string '2015-07-31' (length=10)
public 'lastrecord' => string '1' (length=1)
public 'showdate_tw' => string '104/07/20' (length=9)
public 'paydate_tw' => string '104/07/31' (length=9)
protected 'typeLabels' =>
array (size=4)
0 => string '問貨紀錄表' (length=15)
1 => string '補單紀錄表' (length=15)
2 => string '客戶日銷貨單' (length=18)
3 => string '銷貨退回紀錄表' (length=21)
protected '_dependencyInjector' =>
object(Phalcon\Di\FactoryDefault)[2]
protected '_services' =>
array (size=29)
'router' =>
object(Phalcon\Di\Service)[42]
protected '_name' => string 'router' (length=6)
protected '_definition' =>
it was what I want to fetched by $nowsale->getFirst()...
maybe code was fine but I want to know this reason?
I think you have use >getFirst() method in Filtering Resultsets, so I think it has been return the first record
at that code section I use getFirst() from relation model \Pkerp\Models\SaleState from \Pkerp\Models\Sale but I want to getFirst() from \Pkerp\Models\Sale outside