Added more fields
This commit is contained in:
parent
b7a72add36
commit
d76b4df139
11 changed files with 1568 additions and 6 deletions
38
src/CoreFields/ArrayField.php
Normal file
38
src/CoreFields/ArrayField.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace PhangoApp\PhaModels\CoreFields;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
class ArrayField extends SerializeField {
|
||||
|
||||
/**
|
||||
* This function is used for show the value on a human format
|
||||
*/
|
||||
|
||||
public function show_formatted($value, $key_value='')
|
||||
{
|
||||
|
||||
$real_value=unserialize($value);
|
||||
|
||||
if($key_value==='')
|
||||
{
|
||||
|
||||
return implode(', ', $return_value);
|
||||
|
||||
}
|
||||
else
|
||||
if(isset($real_value[$key_value]))
|
||||
{
|
||||
|
||||
return $real_value[$key_value];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue