Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Sts\WebToko\BO;
- use App;
- use Log;
- use BO;
- use Sts\PleafCore\BusinessTransaction;
- use Sts\PleafCore\DefaultBusinessTransaction;
- use ProductCtgr;
- use Sts\PleafCore\DateUtil;
- /**
- * @author Didi
- */
- class AddProductCtgrAdvance extends DefaultBusinessTransaction implements BusinessTransaction {
- public function getDescription(){
- return "Add Product Category";
- }
- public function prepare ($dto, $originalDto){
- }
- public function process ($dto, $originalDto) {
- $product_ctgr_code = $dto["product_ctgr_code"];
- $product_ctgr_name = $dto["product_ctgr_name"];
- $product_ctgr_parent_id = $dto["product_ctgr_parent_id"];
- $datetime = DateUtil::dateTimeNow();
- $active = _YES;
- $version = 0;
- $username = $dto["username"];
- $ProductCtgr = new ProductCtgr();
- $ProductCtgr->product_ctgr_code = $product_ctgr_code;
- $ProductCtgr->product_ctgr_name = $product_ctgr_name;
- $ProductCtgr->product_ctgr_parent_id = $product_ctgr_parent_id;
- $ProductCtgr->version = $version;
- $ProductCtgr->active = $active;
- $ProductCtgr->active_datetime = $datetime;
- $ProductCtgr->create_datetime = $datetime;
- $ProductCtgr->create_username = $username;
- $ProductCtgr->update_datetime = $datetime;
- $ProductCtgr->update_username = $username;
- $ProductCtgr->save();
- return $ProductCtgr;
- }
- protected function rules() {
- return [
- "product_ctgr_code" => "required",
- "product_ctgr_name" => "required",
- "product_ctgr_parent_id" => "required",
- "datetime" => "required"
- ];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement