PHP Classes

File: classes/db/db-column-constant.php

Recommend this page to a friend!
  Classes of Gonzalo Chumillas   DbTable   classes/db/db-column-constant.php   Download  
File: classes/db/db-column-constant.php
Role: Class source
Content type: text/plain
Description: Class source
Class: DbTable
Update table records in multiple related tables
Author: By
Last change:
Date: 9 years ago
Size: 1,407 bytes
 

Contents

Class file image Download
<?php
/**
 * This file is part of Soloproyectos common library.
 *
 * @author Gonzalo Chumillas <gchumillas@email.com>
 * @license https://github.com/soloproyectos/php.common-libs/blob/master/LICENSE BSD 2-Clause License
 * @link https://github.com/soloproyectos/php.common-libs
 */
namespace com\soloproyectos\common\db;

/**
 * Class DbColumnConstant.
 *
 * This class represents a 'constant column'.
 *
 * @package Db
 * @author Gonzalo Chumillas <gchumillas@email.com>
 * @license https://github.com/soloproyectos/php.common-libs/blob/master/LICENSE BSD 2-Clause License
 * @link https://github.com/soloproyectos/php.common-libs
 */
class DbColumnConstant extends DbColumn
{
   
/**
     * Constant.
     * @var scalar
     */
   
private $_constant = "";
   
   
/**
     * Constructor.
     *
     * @param scalar $constant Constant
     */
   
public function __construct($constant)
    {
       
$this->_constant = $constant;
    }
   
   
/**
     * Gets the original value.
     *
     * This function overrides DbColumn::getOriginalValue()
     *
     * @return string
     */
   
public function getOriginalValue()
    {
        return
$this->_constant;
    }
   
   
/**
     * Gets the column value.
     *
     * This function overrides DbColumn::getValue()
     *
     * @return string
     */
   
public function getValue()
    {
        return
$this->_constant;
    }
}