yii2-model


yii\base\UnknownMethodException error when trying to $model->save() with yii2 non-table model


I'm getting Calling unknown method: app\modules\employee\models\NewEmployeeForm::save() error when trying to do $model->save();
I assumed save() method is inherited from Model, but then this happened. Do I need to write my own save method? I want to follow the yii2 way of doing things.
below is my model
thanks in advance
use common\models\User;
use yii\base\Model;
use Yii;
/**
* Signup form
*/
class NewEmployeeForm extends Model
{
public $nik;
public $pin;
public $company_id;
public $category_id;
public $first_name;
public $last_name;
/**
* #inheritdoc
*/
public function rules()
{
return [
[['pin', 'company_id', 'category_id'], 'integer'],
[['nik'], 'string', 'max' => 255],
[['first_name', 'last_name'], 'string', 'max' => 255],
];
}
}

Related Links

yii2 rules for password custom
yii\base\UnknownMethodException error when trying to $model->save() with yii2 non-table model

Categories

HOME
php
gaming
cucumber
angular-ui-grid
paypal-ipn
redmine
sentry
mailing-list
gtk
azure-graph-api
twitter-oauth
angular4
closures
c#-7.0
gravity
cpu-usage
spring-ldap
el
sharedpreferences
animated-gif
pyopencl
vuforia
introspection
tortoisehg
ccavenue
php-5.3
sfml
locks
john-the-ripper
bootstrap-sass
db2-luw
testlink
stackpanel
twilio-php
installanywhere
macports
aurelia-cli
game-center
grails3.2.0
angular-datatables
contactless-smartcard
absolute
supertest
phppgadmin
comm
maven-jaxb2-plugin
watir-webdriver
webvtt
case-when
openerp-6
email-injection
e
clp
fiber
jemdoc
taco
voronoi
teensy
servicestack-bsd
boost-proto
bayesglm
godeps
ibm-was
ruby-on-rails-4.1
cfwheels
asp.net-web-api-helppages
bjam
gql
wlanapi
actionpack
wicked-gem
python-c-extension
tidyr
mod-auth-openidc
xcode6.3.1
.htpasswd
pbkdf2
notifyjs
google-code-prettify
rikulo
donut-chart
reentrancy
examine
significant-digits
multiple-dispatch
hardcode
winsxs
canonicalization
azure-acs
kernel32
git-log
active-record-query
ccl
explicit
ning
rakudo
error-detection

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App