This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
$inputFilter->add(array( | |
'name' => 'title', | |
'required' => true, | |
'filters' => array( | |
array('name' => 'StripTags'), | |
array('name' => 'StringTrim'), | |
), | |
'validators' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 半角数字のバリデータ | |
* | |
* @return array バリデータのspec | |
*/ | |
public static function digitsValidator() | |
{ | |
return array( | |
'name' =>'Digits', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Album\Helper; | |
use Zend\Form\View\Helper\FormElementErrors as ZendFormElementErrors; | |
/** | |
* フォームのバリデーションエラーメッセージ表示用ビューヘルパー | |
*/ | |
class FormElementErrors extends ZendFormElementErrors | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$resultSet = $this->tableGateway->select(function ($select) { | |
$select->where(array( | |
'id' => 1, | |
'release_date > ?' => date('Y-m-d', strtotime('-1 year')) | |
)); | |
$select->where->like('artist', 'The%'); | |
$select->order('artist'); | |
//echo $select->getSqlString($this->tableGateway->getAdapter()->getPlatform()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sm = $this->getServiceLocator(); | |
$adapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$sql = new \Zend\Db\Sql\Sql($adapter); | |
$select = $sql->select(); | |
$select->from('album'); | |
//echo $select->getSqlString($adapter->getPlatform()); | |
$statement = $sql->prepareStatementForSqlObject($select); | |
$resultSet = $statement->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sm = $this->getServiceLocator(); | |
$adapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$sql = new \Zend\Db\Sql\Sql($adapter); | |
$select = $sql->select(); | |
$select->from('album'); | |
$select->join( | |
'track', | |
'album.id = track.album_id', | |
array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sm = $this->getServiceLocator(); | |
$adapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$sql = new \Zend\Db\Sql\Sql($adapter); | |
$select = $sql->select(); | |
$select->from('album'); | |
$select->join( | |
'track', | |
'album.id = track.album_id', | |
array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sm = $this->getServiceLocator(); | |
$adapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$sql = new \Zend\Db\Sql\Sql($adapter); | |
$select = $sql->select(); | |
$select->from('album'); | |
$select->columns(array( | |
'artist', | |
'latest_release' => new \Zend\Db\Sql\Predicate\Expression('MAX(album.release_date)') | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sm = $this->getServiceLocator(); | |
$adapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$sql = new \Zend\Db\Sql\Sql($adapter); | |
$select = $sql->select(); | |
$select->from('album'); | |
//副問い合わせ用selectオブジェクト | |
$subselect = $sql->select(); | |
$subselect->from('album'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns picture-gallery.component | |
(:require [com.stuartsierra.component :as component] | |
[picture-gallery.handler :refer [app]] | |
[ring.adapter.jetty :refer [run-jetty]]) | |
(:import [com.mchange.v2.c3p0 ComboPooledDataSource DataSources])) | |
(defn pool | |
[spec] | |
(let [cpds (doto (ComboPooledDataSource.) | |
(.setDriverClass (:classname spec)) |
OlderNewer