Pluf Framework

Pluf Framework Git Source Tree

Root/src/Pluf/DB/Field/Compressed.php

1<?php
2/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3/*
4# ***** BEGIN LICENSE BLOCK *****
5# This file is part of Plume Framework, a simple PHP Application Framework.
6# Copyright (C) 2001-2007 Loic d'Anterroches and contributors.
7#
8# Plume Framework is free software; you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License as published by
10# the Free Software Foundation; either version 2.1 of the License, or
11# (at your option) any later version.
12#
13# Plume Framework is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Lesser General Public License for more details.
17#
18# You should have received a copy of the GNU Lesser General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21#
22# ***** END LICENSE BLOCK ***** */
23
24/**
25 * This field will automatically inflate/deflate its content.
26 *
27 * This can be used to store large text bodies where you do not need
28 * to directly search into the content using the standard SQL
29 * functions.
30 */
31class Pluf_DB_Field_Compressed extends Pluf_DB_Field
32{
33 public $type = 'blob';
34
35 function formField($def, $form_field='Pluf_Form_Field_Varchar')
36 {
37 if (!isset($def['widget'])) {
38 $def['widget'] = 'Pluf_Form_Widget_TextareaInput';
39 }
40 return parent::formField($def, $form_field);
41 }
42}
43

Archive Download this file

Branches

Tags