Skip to content

Commit

Permalink
models structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Bizley committed Apr 6, 2017
1 parent 6448864 commit 3df0def
Show file tree
Hide file tree
Showing 7 changed files with 873 additions and 175 deletions.
31 changes: 31 additions & 0 deletions components/db/ActiveRecord.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace app\components\db;

use Yii;

/**
* ActiveRecord extended.
*/
class ActiveRecord extends yii\db\ActiveRecord
{
/**
* Short for load() with POST data.
* @param string|null $formName form name to use to load the data into the model. If not set, formName() is used.
* @return bool
*/
public function loadPost($formName = null)
{
return $this->load(Yii::$app->request->post(), $formName);
}

/**
* Short for load() with GET data.
* @param string|null $formName form name to use to load the data into the model. If not set, formName() is used.
* @return bool
*/
public function loadGet($formName = null)
{
return $this->load(Yii::$app->request->get(), $formName);
}
}
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,5 @@
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"config": {
"process-timeout": 1800
},
"scripts": {
"post-install-cmd": "php init --env=Development --overwrite=n"
}
]
}
64 changes: 0 additions & 64 deletions models/ContactForm.php

This file was deleted.

104 changes: 0 additions & 104 deletions models/User.php

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 3df0def

Please sign in to comment.