dolibarr  7.0.0-beta
Public Member Functions | Static Public Member Functions | List of all members
EcmFiles Class Reference

Class to manage ECM files. More...

Public Member Functions

 __construct (DoliDB $db)
 Constructor. More...
 
 create (User $user, $notrigger=false)
 Create object into database. More...
 
 fetch ($id, $ref= '', $relativepath= '', $hashoffile='', $hashforshare='')
 Load object in memory from the database. More...
 
 fetchAll ($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
 Load object in memory from the database. More...
 
 update (User $user, $notrigger=false)
 Update object into database. More...
 
 delete (User $user, $notrigger=false)
 Delete object in database. More...
 
 createFromClone ($fromid)
 Load an object from its id and create a new one in database. More...
 
 getNomUrl ($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
 Return a link to the object card (with optionaly the picto) More...
 
 getLibStatut ($mode=0)
 Retourne le libelle du status d'un user (actif, inactif) More...
 
 initAsSpecimen ()
 Initialise object with example values Id must be 0 if object instance is a specimen. More...
 

Static Public Member Functions

static LibStatut ($status, $mode=0)
 Return the status. More...
 

Detailed Description

Class to manage ECM files.

Definition at line 36 of file ecmfiles.class.php.

Constructor & Destructor Documentation

EcmFiles::__construct ( DoliDB  $db)

Constructor.

Parameters
DoliDb$dbDatabase handler

Definition at line 78 of file ecmfiles.class.php.

Member Function Documentation

EcmFiles::create ( User  $user,
  $notrigger = false 
)

Create object into database.

Parameters
User$userUser that creates
bool$notriggerfalse=launch triggers after, true=disable triggers
Returns
int <0 if KO, Id of created object if OK

Definition at line 90 of file ecmfiles.class.php.

References $resql, description, dol_hash(), dol_now(), dol_print_error(), dol_strlen(), dol_syslog(), and position.

EcmFiles::createFromClone (   $fromid)

Load an object from its id and create a new one in database.

Parameters
int$fromidId of object to clone
Returns
int New id of clone

Definition at line 642 of file ecmfiles.class.php.

References dol_syslog().

EcmFiles::delete ( User  $user,
  $notrigger = false 
)

Delete object in database.

Parameters
User$userUser that deletes
bool$notriggerfalse=launch triggers after, true=disable triggers
Returns
int <0 if KO, >0 if OK

Definition at line 589 of file ecmfiles.class.php.

References $resql, and dol_syslog().

EcmFiles::fetch (   $id,
  $ref = '',
  $relativepath = '',
  $hashoffile = '',
  $hashforshare = '' 
)

Load object in memory from the database.

Parameters
int$idId object
string$refHash of file name (filename+filepath). Not always defined on some version.
string$relativepathRelative path of file from document directory. Example: path/path2/file
string$hashoffileHash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
string$hashforshareHash of file sharing.
Returns
int <0 if KO, 0 if not found, >0 if OK

Definition at line 263 of file ecmfiles.class.php.

References $resql, description, dol_syslog(), and position.

EcmFiles::fetchAll (   $sortorder = '',
  $sortfield = '',
  $limit = 0,
  $offset = 0,
array  $filter = array(),
  $filtermode = 'AND' 
)

Load object in memory from the database.

Parameters
string$sortorderSort Order
string$sortfieldSort field
int$limitoffset limit
int$offsetoffset limit
array$filterfilter array
string$filtermodefilter mode (AND or OR)
Returns
int <0 if KO, >0 if OK

Definition at line 375 of file ecmfiles.class.php.

References $resql, and dol_syslog().

EcmFiles::getLibStatut (   $mode = 0)

Retourne le libelle du status d'un user (actif, inactif)

Parameters
int$mode0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
Returns
string Label of status

Definition at line 741 of file ecmfiles.class.php.

References LibStatut().

EcmFiles::getNomUrl (   $withpicto = 0,
  $option = '',
  $notooltip = 0,
  $maxlen = 24,
  $morecss = '' 
)

Return a link to the object card (with optionaly the picto)

Parameters
int$withpictoInclude picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
string$optionOn what the link point to
int$notooltip1=Disable tooltip
int$maxlenMax length of visible user name
string$morecssAdd more css on link
Returns
string String with URL

Definition at line 692 of file ecmfiles.class.php.

EcmFiles::initAsSpecimen ( )

Initialise object with example values Id must be 0 if object instance is a specimen.

Returns
void

Definition at line 766 of file ecmfiles.class.php.

References description, dol_now(), and position.

static EcmFiles::LibStatut (   $status,
  $mode = 0 
)
static

Return the status.

Parameters
int$statusId status
int$mode0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto
Returns
string Label of status

Definition at line 753 of file ecmfiles.class.php.

Referenced by getLibStatut().

EcmFiles::update ( User  $user,
  $notrigger = false 
)

Update object into database.

Parameters
User$userUser that modifies
bool$notriggerfalse=launch triggers after, true=disable triggers
Returns
int <0 if KO, >0 if OK

Definition at line 470 of file ecmfiles.class.php.

References $resql, description, dol_strlen(), dol_syslog(), and position.


The documentation for this class was generated from the following file: