altocompta/include/class_attribut.php
Dany De Bontridder fd7516f391 Merged revisions 3329-3332 via svnmerge from
svn+ssh://danydb@svn/svn/phpcompta/branches/rel510

........
  r3329 | danydb | 2010-06-23 18:18:21 +0200 (Wed, 23 Jun 2010) | 2 lines
  
  Check if the plugin does exist
........
  r3330 | danydb | 2010-06-23 18:23:10 +0200 (Wed, 23 Jun 2010) | 2 lines
  
  check if file exists for the plugin
........
  r3331 | danydb | 2010-06-23 18:29:36 +0200 (Wed, 23 Jun 2010) | 1 line
  
  Improve extension : add preferences, check on the file to include
........
  r3332 | danydb | 2010-06-23 18:31:17 +0200 (Wed, 23 Jun 2010) | 3 lines
  
  Attribut : add a sort on object with usort (faster)
  Add new method for card : setAttribut
  Fiche_Def after an insert the $this->id is now set
........
2010-06-24 06:54:41 +00:00

49 lines
1.5 KiB
PHP

<?php
/*
* This file is part of PhpCompta.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*! \file
* \brief Manage the attribut of the card
*/
/*!
* \brief Manage the attribut of the card
*/
class Attribut {
var $ad_id; /*!< pk for attribut */
var $ad_text; /*!< type of content */
var $av_text; /*!< Description (content) */
var $jnt_order; /*!< order of the attribut */
var $cn; /*!< database connection */
function Attribut($p_ad_id) {
$this->ad_id=$p_ad_id;
$this->cn=-1;
}
/*!
*@brief used with a usort function, to sort an array of Attribut on the attribut_id (ad_id)
*/
static function sort_by_id($o1,$o2) {
if ( $o1->ad_id > $o2->ad_id ) return 1;
if ( $o1->ad_id == $o2->ad_id ) return 0;
return -1;
}
}