2012-02-23から1日間の記事一覧

しかし、変数の型宣言が「出来ない」というPHPの恐ろしい仕様になれてきている自分が怖い‥‥

ちなみに、現実の条件生成はもっとメンドクセーですじょ? select(); // 中略 // 案件の状態 if (!is_a($sc->getState(), 'nothing')) { $tarState = null; if(is_a($sc->getState(), 'Model_ItemState_Interface')) { $tarState = $sc->getState(); } else …

しょうが無いので、Zend_DB_Selectを修正。 _parts[self::WHERE][] = $this->_where($cond, $value, $type, true); return $this; } // after public function where($cond, $value = null, $type = null) { // if $cond is null then ignore. if (…

Zend_FrameworkのZend_DB_Select、これには順次処理でwhere文を生成する仕組みがあるのですが、単純な連結には便利でも複合条件の連結が使いにくくてタマラン、ということでhelperクラスを作ったのですよ。Zend_DB_Selectのwhereメソッドの例 select(); $que…