 the modification of the data.</p>
<p>This is how you define an event which is executed before an entity is created:</p>
<div class="highlight-php"><div class="highlight"><pre><span></span><span class="x">$app[&#39;crud&#39;]-&gt;getData(&#39;library&#39;)-&gt;pushEvent(&#39;before&#39;, &#39;create&#39;, function(CRUDlex\Entity $entity) {</span>
<span class="x">    // Do something with the entity which is about to be saved.</span>
<span class="x">    return true;</span>
<span class="x">});</span>
</pre></d