- return $callback($this->getConnection()->execParams($query, $query->getParams(), $query->getTypes()));
+ $this->result = null;
+ $this->query = $query;
+ $this->notify();
+ $this->result = $this->getConnection()->execParams($query, $query->getParams(), $query->getTypes());
+ $this->notify();
+ return $callback($this->result);
+ }
+
+ /**
+ * @implements \SplSubject
+ * @param \SplObserver $observer
+ */
+ function attach(\SplObserver $observer) {
+ $this->observers->attach($observer);
+ }
+
+ /**
+ * @implements \SplSubject
+ * @param \SplObserver $observer
+ */
+ function detach(\SplObserver $observer) {
+ $this->observers->detach($observer);
+ }
+
+ /**
+ * @implements \SplSubject
+ */
+ function notify() {
+ foreach ($this->observers as $observer){
+ $observer->update($this);
+ }