Did a thing today, ‘nother new package.

New Package: Stripe + CommandBus + Yii2 I got tired of writing out the entire Stripe class requirements coupled with the need to trigger stripe events from different areas of the application  motivated me to create this package. It is by far NOT production ready but lays the ground work and ideas for the package. Take …

Yii2 hasOne vs hasMany param order

hasOne() * * public function getCountry() * { * return $this->hasOne(Country::className(), [‘id’ => ‘country_id’]); * } * hasMany() * * public function getOrders() * { * return $this->hasMany(Order::className(), [‘customer_id’ => ‘id’]); * } * Notice the opposite order? The docs explain why but it’s still confusing. Ticket submitted.

Yii2 AR SQL Verbs; Y-U-SO-WEIRD?

Yii2 being an active record style DB abstraction AND needing to support a wide range of database technologies facilitated creating the standard insert / select / update / delete functionality inside the Active Record model layer. While most of implementation makes sense some of it is not intuitive. Herein is a TL;DR of the 4 …

Quick little thing.

Was sad to see Yii2’s getOldAttributes() did not have to ability to limit based on a provided array; whereas getAttributes() does take an array to limit the returned attributes. So I whipped this up right quick: /** * @param array $array * * @return array */ public function getOldAttributes($array = []) { $returnData = parent::getOldAttributes(); …