コード例 #1
0
 public function getPrices()
 {
     return $this->hasMany(tPrice::className(), ['idExpense' => 'id']);
 }
コード例 #2
0
 public function testCreatePrice()
 {
     //simulate form input
     $post = ['tPrice' => ['Price' => '110.00', 'Cost' => '100.00', 'Discount' => '0', 'QuantityMeasure' => '796', 'Quantity' => '1']];
     $price = new tPrice();
     $this->assertTrue($price->load($post), 'Load price POST data');
     $this->assertTrue($price->validate(), 'Validate price');
     $this->assertTrue($price->save(), 'Create price');
     return $price;
 }