auditor-bundle icon indicating copy to clipboard operation
auditor-bundle copied to clipboard

auditable methods (relates to JOINED inheritance)

Open kor3k opened this issue 3 years ago • 0 comments

since JOINED inheritance is not currently supported, what about allowing arbitrary method return values to get audited?

something like this.

//joined inheritance applied User -> Admin

class User
{
    private ?string $username;

    public method getUsername(): ?string
    {
        return $this->username;
    }
}

/**
* @Audit\Auditable
*/
class Admin extends User
{
    /**
    * @Audit\Auditable
    */
    public function getUsername(): ?string
    {
        return parent::getUsername();
    }
}

as a result, username gets logged in admin_audit table.

how difficult would be to implement this?

kor3k avatar Oct 24 '21 15:10 kor3k