ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDidacticTemplateFilterPattern Class Reference

Represents a filter pattern for didactic template actions. More...

+ Inheritance diagram for ilDidacticTemplateFilterPattern:
+ Collaboration diagram for ilDidacticTemplateFilterPattern:

Public Member Functions

 __construct ($a_pattern_id=0)
 Constructor.
 setPatternId ($a_id)
 set pattern id
 getPatternId ()
 Get pattern id.
 setParentId ($a_id)
 Set parent id.
 getParentId ()
 Get parent id.
 setParentType ($a_type)
 Set parent type.
 getParentType ()
 Get parent type.
 setPatternType ($a_type)
 Set pattern type.
 getPatterType ()
 Get pattern type.
 setPatternSubType ($a_subtype)
 Set pattern sub type.
 getPatternSubType ()
 Get pattern sub type.
 setPattern ($a_pattern)
 Set pattern.
 getPattern ()
 Get pattern.
 valid ($a_source)
 Check if pattern matches.
 toXml (ilXmlWriter $writer)
 Get xml representation of pattern.
 update ()
 Update pattern definition.
 save ()
 Create new pattern ilDB $ilDB.
 delete ()
 Delete pattern ilDB $ilDB.
 __clone ()
 Magic clone method.

Data Fields

const PATTERN_INCLUDE = 1
const PATTERN_EXCLUDE = 2
const PATTERN_SUBTYPE_REGEX = 1

Protected Member Functions

 read ()
 Read pattern definition from db.

Private Attributes

 $pattern_id = 0
 $parent_id = 0
 $parent_type = ''
 $pattern_type = 0
 $pattern_sub_type = 0

Detailed Description

Represents a filter pattern for didactic template actions.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 11 of file class.ilDidacticTemplateFilterPattern.php.

Constructor & Destructor Documentation

ilDidacticTemplateFilterPattern::__construct (   $a_pattern_id = 0)

Constructor.

Parameters
int$a_pattern_id

Reimplemented in ilDidacticTemplateIncludeFilterPattern, and ilDidacticTemplateExcludeFilterPattern.

Definition at line 32 of file class.ilDidacticTemplateFilterPattern.php.

References getPatternId(), read(), and setPatternId().

{
$this->setPatternId($a_pattern_id);
if($this->getPatternId())
{
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilDidacticTemplateFilterPattern::__clone ( )

Magic clone method.

Definition at line 226 of file class.ilDidacticTemplateFilterPattern.php.

References setParentId(), and setPatternId().

{
$this->setParentId(0);
$this->setPatternId(0);
}

+ Here is the call graph for this function:

ilDidacticTemplateFilterPattern::delete ( )

Delete pattern ilDB $ilDB.

Returns
bool

Definition at line 213 of file class.ilDidacticTemplateFilterPattern.php.

References $query, and getPatternId().

{
global $ilDB;
$query = 'DELETE FROM didactic_tpl_fp '.
'WHERE pattern_id = '.$ilDB->quote($this->getPatternId(),'integer');
$ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

ilDidacticTemplateFilterPattern::getParentId ( )

Get parent id.

Returns
int

Definition at line 72 of file class.ilDidacticTemplateFilterPattern.php.

References $parent_id.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::getParentType ( )

Get parent type.

Returns
string

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

References $parent_type.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::getPattern ( )
ilDidacticTemplateFilterPattern::getPatternId ( )

Get pattern id.

Returns
int

Definition at line 54 of file class.ilDidacticTemplateFilterPattern.php.

References $pattern_id.

Referenced by __construct(), delete(), read(), save(), and update().

{
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::getPatternSubType ( )
ilDidacticTemplateFilterPattern::getPatterType ( )

Get pattern type.

Returns
int

Definition at line 108 of file class.ilDidacticTemplateFilterPattern.php.

References $pattern_type.

Referenced by save(), and update().

{
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::read ( )
protected

Read pattern definition from db.

Returns
void

Definition at line 237 of file class.ilDidacticTemplateFilterPattern.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, getPatternId(), setPattern(), setPatternSubType(), and setPatternType().

Referenced by __construct().

{
global $ilDB;
$query = 'SELECT * FROM didactic_tpl_fp '.
'WHERE pattern_id = '.$ilDB->quote($this->getPatternId(),'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setPatternType($row->pattern_type);
$this->setPatternSubType($row->pattern_sub_type);
$this->setPattern($row->pattern);
}
return void;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::save ( )

Create new pattern ilDB $ilDB.

Returns
int

Definition at line 190 of file class.ilDidacticTemplateFilterPattern.php.

References $query, getParentId(), getParentType(), getPattern(), getPatternId(), getPatternSubType(), getPatterType(), and setPatternId().

{
global $ilDB;
$this->setPatternId($ilDB->nextId('didactic_tpl_fp'));
$query = 'INSERT INTO didactic_tpl_fp (pattern_id,pattern_type,pattern_sub_type,pattern,parent_id,parent_type) '.
'VALUES ( '.
$ilDB->quote($this->getPatternId(),'integer').', '.
$ilDB->quote($this->getPatterType(),'integer').', '.
$ilDB->quote($this->getPatternSubType(),'integer').', '.
$ilDB->quote($this->getPattern(),'text').', '.
$ilDB->quote($this->getParentId(),'integer').', '.
$ilDB->quote($this->getParentType(),'text').' '.
')';
$ilDB->manipulate($query);
return $this->getPatternId();
}

+ Here is the call graph for this function:

ilDidacticTemplateFilterPattern::setParentId (   $a_id)

Set parent id.

Parameters
int$a_id

Definition at line 63 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by __clone().

{
$this->parent_id = $a_id;
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::setParentType (   $a_type)

Set parent type.

Parameters
string$a_type

Definition at line 81 of file class.ilDidacticTemplateFilterPattern.php.

{
$this->parent_type = $a_type;
}
ilDidacticTemplateFilterPattern::setPattern (   $a_pattern)

Set pattern.

Parameters
string$a_pattern

Definition at line 135 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by read().

{
$this->pattern = $a_pattern;
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::setPatternId (   $a_id)

set pattern id

Parameters
int$a_id

Definition at line 45 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by __clone(), __construct(), and save().

{
$this->pattern_id = $a_id;
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::setPatternSubType (   $a_subtype)

Set pattern sub type.

Parameters
int$a_subtype

Definition at line 117 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by read().

{
$this->pattern_sub_type = $a_subtype;
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::setPatternType (   $a_type)

Set pattern type.

Parameters
int$a_type

Definition at line 99 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by ilDidacticTemplateExcludeFilterPattern\__construct(), ilDidacticTemplateIncludeFilterPattern\__construct(), and read().

{
$this->pattern_type = $a_type;
}

+ Here is the caller graph for this function:

ilDidacticTemplateFilterPattern::toXml ( ilXmlWriter  $writer)
abstract

Get xml representation of pattern.

Parameters
ilXmlWriter$writer
Returns
void

Reimplemented in ilDidacticTemplateIncludeFilterPattern, and ilDidacticTemplateExcludeFilterPattern.

ilDidacticTemplateFilterPattern::update ( )

Update pattern definition.

Definition at line 169 of file class.ilDidacticTemplateFilterPattern.php.

References $query, $res, getParentId(), getParentType(), getPattern(), getPatternId(), getPatternSubType(), and getPatterType().

{
global $ilDB;
$query = 'UPDATE didactic_tpl_fp '.
'SET '.
'pattern_type = '.$ilDB->quote($this->getPatterType(),'integer').', '.
'pattern_sub_type = '.$ilDB->quote($this->getPatternSubType(),'integer').' '.
'pattern = '.$ilDB->quote($this->getPattern(),'text').' '.
'parent_id = '.$ilDB->quote($this->getParentId(),'integer').', '.
'parent_type = '.$ilDB->quote($this->getParentType(),'text').', '.
'WHERE pattern_id = '.$ilDB->quote($this->getPatternId(),'integer');
$res = $ilDB->manipulate($query);
return void;
}

+ Here is the call graph for this function:

ilDidacticTemplateFilterPattern::valid (   $a_source)
abstract

Check if pattern matches.

Parameters
mixed
Returns
bool

Reimplemented in ilDidacticTemplateIncludeFilterPattern, and ilDidacticTemplateExcludeFilterPattern.

Field Documentation

ilDidacticTemplateFilterPattern::$parent_id = 0
private

Definition at line 20 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by getParentId().

ilDidacticTemplateFilterPattern::$parent_type = ''
private

Definition at line 21 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by getParentType().

ilDidacticTemplateFilterPattern::$pattern_id = 0
private

Definition at line 18 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by getPatternId().

ilDidacticTemplateFilterPattern::$pattern_sub_type = 0
private

Definition at line 24 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by getPatternSubType().

ilDidacticTemplateFilterPattern::$pattern_type = 0
private

Definition at line 23 of file class.ilDidacticTemplateFilterPattern.php.

Referenced by getPatterType().

const ilDidacticTemplateFilterPattern::PATTERN_EXCLUDE = 2
const ilDidacticTemplateFilterPattern::PATTERN_INCLUDE = 1
const ilDidacticTemplateFilterPattern::PATTERN_SUBTYPE_REGEX = 1

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