Event don't fired when create object with model

I create business logic with php.

// event listener for table "one"


public function beforeCreate( $runner_context, $one) {
 // create account
$amount=$one->getAmount();


 $account = new account();
 $account->setAmount($amount);


 $account->setOwnerId($runner_context->getUserId());
 $account->save();
 }

And event beforeCreate for table “account” didn’t fired.

When I do the same with RequestBilder, event din’t fired also.

RequestBuilder::doRequestWithHeaders( 'data', 'account', ["amount"=>$amount], 'POST', ['Content-Type'=>'application/json', "user-token"=>$runner_context->getUserToken()]);

Hello, Anton!

How do you invoke “create” event? I see the beforeCreate handler, but what about the code you exactly create “one” object with?
regards,
Alex

For table “one” - event fired successful.
Problem with table account.
Code below was generated by backendless.
but it is not output in debug console (var_dump("!!!");).

<?php
namespace com\oc\events\persistence_service;

use backendless\core\extension\BasePersistenceEventHandler;
use backendless\BackendlessCollection;
use backendless\model\GeoPoint;
use backendless\model\GeoCategory;
use backendless\Backendless;            
use backendless\services\persistence\BackendlessDataQuery;
use backendless\core\servercode\ExecutionResult;            
use backendless\core\servercode\RunnerContext;            
        
use com\backendless\oc\models\account;

        
/**
* AccountTableEventHandler handles events for all entities. This is accomplished
* with the  @annot({ Asset:"account"})   annotation. 
* The methods in the class correspond to the events selected in Backendless
* Console.
*/
    
/** @annot({"Asset":"account"}) */ 

class AccountTableEventHandler extends  BasePersistenceEventHandler 
{
    
  public function beforeCreate( $runner_context, $account ) {

    // add your code here
    var_dump("!!!!!!!");
  }
    
}

Are you able to see the event handler in Debug console when running it in debug mode?
I mean here: https://monosnap.com/file/KIzqmCRhfZxIJdFjJ1Zmg1KTGJgXYj

Hm… it is miracle… all works now.

Okay, notify us if you face this problem again. I’ll mark it as solved for now.