티스토리 뷰
Jelly Module 사용하기
Jelly Class
- meta
- field
- model
- validation
- event
- collection
- builder
- behavior
기본 사용 방법
jelly Model 의 정의
Jelly Class
- meta
- field
- model
- validation
- event
- collection
- builder
- behavior
기본 사용 방법
jelly Model 의 정의
class Model_Board_Old_Article extends Jelly_Model
{
public static function initialize(Jelly_Meta $meta)
{
$meta->table("ha_board")->fields(array(
'b_no' => Jelly::field('primary'),
'b_group_no' => Jelly::field('integer'),
'b_depth_no' => Jelly::field('integer', array(
'default' => 0
)),
'b_order_no' => Jelly::field('integer', array(
'default' => 0
)),
'b_subject' => Jelly::field('string'),
'b_bc_id' => Jelly::field('integer'),
'b_ca_id' => Jelly::field('integer', array(
'default' => 1
)),
'b_deleted' => Jelly::field('string', array(
'default' => 'N'
)),
'b_secreted' => Jelly::field('string', array(
'default' => 'N'
)),
'b_client_ip' => Jelly::field('string', array(
'default' => $_SERVER['REMOTE_ADDR']
)),
'b_content' => Jelly::field('text'),
'b_created' => Jelly::field('timestamp', array(
'auto_now_create' => TRUE
)),
'b_updated' => Jelly::field('timestamp', array(
'auto_now_update' => TRUE
)),
));
}
public function totalCount()
{
return Jelly::query($this)->select()->count();
}
public function getTopRecod( $startNum )
{
$aData = jelly::query($this)->select_column(array("b_group_no", "b_order_no"))->order_by("b_group_no", "asc")->order_by("b_order_no", "asc")->offset($startNum)->limit(1)->as_assoc()->select();
return array( $aData['b_group_no'], $aData['b_order_no']);
}
}
$result = Jelly::query('Board_Old_Article')->select_column(array('min("b_group_no") as group_min'))->as_assoc()->select()->current();
'웹개발 > Php' 카테고리의 다른 글
| ckFinder 설정 (0) | 2012.03.01 |
|---|---|
| Jelly Validation Memo (0) | 2012.02.29 |
| Kohana module init 설정 내용 예제들 (0) | 2012.02.18 |
| 에디트 플러스 와 phpunit 연동 테스팅 하기 (0) | 2012.02.04 |
| ReflectionClass 클래스를 사용하여 인스턴스 얻기 (0) | 2012.02.02 |
댓글