eesyphp/src/Db/AttrStr.php
Benjamin Renard 347de8eeaf
Add DbObject
2024-02-18 18:27:58 +01:00

28 lines
643 B
PHP

<?php
namespace EesyPHP\Db;
class AttrStr extends Attr {
/**
* Compute attribute value from DB
* @param string|null $value The value as retrieved from debug
* @return string|null The attribute value
*/
public function from_db($value) {
$value = parent::from_db($value);
return is_null($value)?null:strval($value);
}
/**
* Compute attribute value for DB
* @param string|null $value The value as handled in PHP
* @return string|null The attribute value as stored in DB
*/
public function to_db($value) {
$value = parent::from_db($value);
return is_null($value)?null:strval($value);
}
}