Source for file text.php

Documentation is available at text.php

  1. <?php
  2. /**
  3.  * @package     FrameworkOnFramework
  4.  * @subpackage  model
  5.  * @copyright   Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
  6.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8. // Protect from unauthorized access
  9. defined('_JEXEC'or die;
  10.  
  11. /**
  12.  * FrameworkOnFramework model behavior class
  13.  *
  14.  * @package  FrameworkOnFramework
  15.  * @since    2.1
  16.  */
  17. {
  18.     /**
  19.      * Constructor
  20.      *
  21.      * @param   JDatabaseDriver  $db     The database object
  22.      * @param   object           $field  The field informations as taken from the db
  23.      */
  24.     public function __construct($db$field$table_alias false)
  25.     {
  26.         parent::__construct($db$field$table_alias false);
  27.  
  28.         $this->null_value = '';
  29.     }
  30.  
  31.     /**
  32.      * Returns the default search method for this field.
  33.      *
  34.      * @return  string 
  35.      */
  36.     public function getDefaultSearchMethod()
  37.     {
  38.         return 'partial';
  39.     }
  40.  
  41.     /**
  42.      * Perform a partial match (search in string)
  43.      *
  44.      * @param   mixed  $value  The value to compare to
  45.      *
  46.      * @return  string  The SQL where clause for this search
  47.      */
  48.     public function partial($value)
  49.     {
  50.         if ($this->isEmpty($value))
  51.         {
  52.             return '';
  53.         }
  54.  
  55.         return '(' $this->getFieldName(' LIKE ' $this->_db->quote('%' $value '%'')';
  56.     }
  57.  
  58.     /**
  59.      * Perform an exact match (match string)
  60.      *
  61.      * @param   mixed  $value  The value to compare to
  62.      *
  63.      * @return  string  The SQL where clause for this search
  64.      */
  65.     public function exact($value)
  66.     {
  67.         if ($this->isEmpty($value))
  68.         {
  69.             return '';
  70.         }
  71.  
  72.         return '(' $this->getFieldName(' LIKE ' $this->_db->quote($value')';
  73.     }
  74.  
  75.     /**
  76.      * Dummy method; this search makes no sense for text fields
  77.      *
  78.      * @param   mixed    $from     Ignored
  79.      * @param   mixed    $to       Ignored
  80.      * @param   boolean  $include  Ignored
  81.      *
  82.      * @return  string  Empty string
  83.      */
  84.     public function between($from$to$include true)
  85.     {
  86.         return '';
  87.     }
  88.  
  89.     /**
  90.      * Dummy method; this search makes no sense for text fields
  91.      *
  92.      * @param   mixed    $from     Ignored
  93.      * @param   mixed    $to       Ignored
  94.      * @param   boolean  $include  Ignored
  95.      *
  96.      * @return  string  Empty string
  97.      */
  98.     public function outside($from$to$include false)
  99.     {
  100.         return '';
  101.     }
  102.  
  103.     /**
  104.      * Dummy method; this search makes no sense for text fields
  105.      *
  106.      * @param   mixed    $value     Ignored
  107.      * @param   mixed    $interval  Ignored
  108.      * @param   boolean  $include   Ignored
  109.      *
  110.      * @return  string  Empty string
  111.      */
  112.     public function interval($value$interval$include true)
  113.     {
  114.         return '';
  115.     }
  116. }

Documentation generated on Tue, 19 Nov 2013 15:15:40 +0100 by phpDocumentor 1.4.3