Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function isExistClientProductCode($clientProductCod)
- {
- $table = TableRegistry(..);
- $entity = $table->find()
- ->where(['client_product_code' => $clientProductCod])
- ->first();
- $return $entity();
- }
- public function create($entityProduct)
- {
- $table = TableRegistry();
- $entity = new Entity();
- $entity = $entityProduct->product_uuid;
- $entity = $entityProduct->clientProductCode;
- $table->save($entity);
- }
- public function update($clientProductCode)
- {
- $table = TableRegistry();
- $entity = $table->find()
- ->where(['client_product_code' => $clientProductCod]);
- $entity->modified = null;
- $table->save();
- }
- $product = $product->findProductByClientCode();
- if($product)
- {
- if(isExistClientProductCode($clientProductCode)){
- domain->update($clientProductCode);
- }else{
- domain->create($product);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement