public function onBeforeWrite()
    {
        parent::onBeforeWrite();

        if (empty($this->Secret)) {
            $this->Secret = $this->generateSecret();
        }

        if (empty($this->Identifier)) {
            $this->Identifier = $this->generateSecret();
        }
    }
public function onBeforeWrite()
    {
        parent::onBeforeWrite();

        if (empty($this->Secret)) {
            $this->Secret = $this->generateSecret();
        }

        if (empty($this->Identifier)) {
            $this->Identifier = $this->generateSecret();
        }
    }
public function onBeforeWrite ( ) { parent :: onBeforeWrite ( ) ; if ( empty ( $ this -> Secret ) ) { $ this -> Secret = $ this -> generateSecret ( ) ; } if ( empty ( $ this -> Identifier ) ) { $ this -> Identifier = $ this -> generateSecret ( ) ; } }
On before write. Generate a secret if we don't have one.
On before write . Generate a secret if we don t have one .