# Use of the return value of StatementInterface::execute()

**URL:** <https://discourse.laminas.dev/t/use-of-the-return-value-of-statementinterface-execute/1527>\
**Category:** Components & MVC\
**Tags:** laminas-db\
**Created:** [April 14, 2020, 3:13pm UTC](https://discourse.laminas.dev/t/use-of-the-return-value-of-statementinterface-execute/1527 "2020-04-14T15:13:18Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)\
**Post date:** [April 15, 2020, 7:11am UTC](https://discourse.laminas.dev/t/use-of-the-return-value-of-statementinterface-execute/1527/5 "2020-04-15T07:11:39Z")

</div>

> [@CDW](#):
>
> Here is my class.

The MVC component is event driven and therefore you can use a listener which is listen to one of [the existing MVC events](https://docs.laminas.dev/laminas-mvc/mvc-event/#order-of-events). In the listener you can execute your code.  
This allows to define when your code will be executed (listener is triggered) and you can access the servicemanager of your application (to get the database adapter or something else).

Some examples can be found in the documentation or here in the forum.

One of the examples: [Redirecting...](https://docs.laminas.dev/laminas-view/cookbook/setting-module-specific-layouts/)

---

_[View the full topic](https://discourse.laminas.dev/t/use-of-the-return-value-of-statementinterface-execute/1527)._
