public function testObjectCall() { $t = new Table3(); $this->assertEquals('bar', $t->foo(), 'objectCall hook is called when building the magic __call()'); }
public function testPostDelete() { $t = new Table3(); $t->save(); $this->postDelete = 0; $t->delete(); $this->assertEquals($t->postDelete, 1, 'postDelete hook is called on object deletion'); $this->assertFalse($t->postDeleteIsBeforeDelete, 'postDelete hook is called before deletion'); }
/** * @return \yii\db\ActiveQuery */ public function getTable3s() { return $this->hasMany(Table3::className(), ['t4_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getT3() { return $this->hasOne(Table3::className(), ['id' => 't3_id']); }