31 public function set( $value ) {
39 public function get() {
48 public function setValue( $arg0 =
null, $arg1 =
null ) {
49 $this->
set( $arg0, $arg1 );
59 return $this->
get( $arg0 );
145 parent::__construct( $name );
147 $this->mName = $name;
156 public function set( $value ) {
157 $this->mValue = $value;
168 public function get( $index = null ) {
191 return null === $this->mValue || (is_string($this->mValue) && trim($this->mValue) ===
'');
219 return htmlspecialchars( $this->
toString(), ENT_QUOTES );
269 $this->mPropertyClassName = $classname;
270 $this->mName = $name;
288 public function set( $arg1, $arg2 = null ) {
289 if ( is_array( $arg1 ) && $arg2 ===
null ) {
291 foreach ( $arg1 as $t_key => $t_value ) {
292 $this->
_set( $t_key, $t_value );
294 } elseif ( $arg1 ===
null && $arg2 ===
null ) {
296 } elseif ( $arg1 !==
null && $arg2 !==
null ) {
297 $this->
_set( $arg1, $arg2 );
308 public function add( $arg1, $arg2 =
null ) {
309 if ( is_array( $arg1 ) && $arg2 ===
null ) {
310 foreach ( $arg1 as $t_key => $t_value ) {
311 $this->
_set( $t_key, $t_value );
313 } elseif ( $arg1 !==
null && $arg2 !==
null ) {
314 $this->
_set( (
string) $arg1, $arg2 );
327 public function _set( $index, $value ) {
328 if ( ! isset( $this->mProperties[ $index ] ) ) {
329 $this->mProperties[ $index ] =
new $this->mPropertyClassName( $this->mName );
331 $this->mProperties[ $index ]->set( $value );
342 public function get( $index = null ) {
343 if (
null === $index ) {
346 foreach ( $this->mProperties as $t_key => $t_value ) {
347 $ret[ $t_key ] = $t_value->get();
353 return isset( $this->mProperties[ $index ] ) ? $this->mProperties[ $index ]->get() :
null;
361 unset( $this->mProperties );
362 $this->mProperties = [];
384 return ( 0 === count( $this->mProperties ) );
412 return htmlspecialchars( $this->
toString(), ENT_QUOTES );
431 parent::__construct( $this->mPropertyClassName, $name );
441 public function set( $value ) {
442 $this->mValue = (int) $value ? 1 : 0;
453 parent::__construct(
'XCube_BoolProperty', $name );
462 public function set($value) {
463 $this->mValue = (
null !== $value &&
'' !== (string)$value) ? (
int)$value :
null;
474 parent::__construct(
'XCube_IntProperty', $name );
483 public function set( $value ) {
484 $this->mValue =
'' !== trim( $value ) ? (float) $value :
null;
495 parent::__construct(
'XCube_FloatProperty', $name );
507 public function set( $value ) {
514 $this->mValue = filter_var($value, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW);
529 parent::__construct(
'XCube_StringProperty', $name );
541 public function set( $value ) {
548 $this->mValue = preg_replace(
"/[\\x00-\\x08]|[\\x0b-\\x0c]|[\\x0e-\\x1f]/",
'', $value );
563 parent::__construct(
'XCube_TextProperty', $name );
582 parent::__construct( $name );
591 if ( ! is_object( $this->mValue ) ) {
595 if (
null !== $this->mIndex ) {
599 $this->mValue->fetch();
601 if ( ! $this->mValue->hasUploadFile() ) {
602 $this->mValue =
null;
607 if ( ! is_object( $this->mValue ) ) {
611 return ! $this->mValue->hasUploadFile();
630 parent::__construct(
'XCube_FileProperty', $name );
638 unset( $this->mProperties );
639 $this->mProperties = [];
640 if ( isset( $_FILES[ $this->mName ] ) && is_array( $_FILES[ $this->mName ][
'name'] ) ) {
641 foreach ( $_FILES[ $this->mName ][
'name'] as $_key => $_val ) {
642 $this->mProperties[ $_key ] =
new $this->mPropertyClassName( $this->mName );
643 $this->mProperties[ $_key ]->mIndex = $_key;
644 $this->mProperties[ $_key ]->fetch( $form );
657 parent::__construct( $name );
669 parent::__construct(
'XCube_ImageFileProperty', $name );
__construct( $name)
Constructor.
[Abstract] The base class which implements XCube_PropertyInterface, for all properties.
isArray()
Gets a value indicating whether this object expresses Array.
toNumber()
Gets a value as integer.
isNull()
Gets a value indicating whether this object is null.
toString()
Gets a value as string.
__construct( $name)
Constructor.
hasFetchControl()
Gets a value indicating whether this object has a fetch control.
toHTML()
Gets a value as encoded HTML code.
Represents bool[] property. XCube_GenericArrayProperty<XCube_BoolProperty>.
__construct( $name)
Constructor.
Represents bool property.
Represents the special property[] which handles uploaded file. XCube_GenericArrayProperty<XCube_FileP...
__construct( $name)
Constructor.
hasFetchControl()
Gets a value indicating whether this object has a fetch control.
Represents the special property which handles uploaded file.
toNumber()
Gets a value as integer.
$mIndex
mixed - ID for XCube_FileArrayProperty.
isNull()
Gets a value indicating whether this object is null.
toString()
Gets a value as string.
__construct( $name)
Constructor.
hasFetchControl()
Gets a value indicating whether this object has a fetch control.
Represents float[] property. XCube_GenericArrayProperty<XCube_FloatProperty>.
__construct( $name)
Constructor.
Represents float property.
[Abstract] Defines common array property class which implements XCube_PropertyInterface.
isArray()
Gets a value indicating whether this object expresses Array.
toNumber()
Gets a value as integer — but, gets null always.
reset()
Resets all properties of this.
isNull()
Gets a value indicating whether this object is null.
toString()
Gets a value as string — but, gets 'Array' always.
__construct( $classname, $name)
Constructor.
$mProperties
XCube_AbstractProperty[] - std::map<mixed_key, mixed_value>
$mPropertyClassName
string - <T>
hasFetchControl()
Gets a value indicating whether this object has a fetch control.
_set( $index, $value)
This member function helps set().
toHTML()
Gets a value as encoded HTML code — but, gets 'Array' always.
XCube_GenericArrayProperty<XCube_ImageFileProperty>.
__construct( $name)
Constructor.
This is extended XCube_FileProperty and limits uploaded files by image files.
__construct( $name)
Constructor.
Represents int[] property. XCube_GenericArrayProperty<XCube_IntProperty>.
__construct( $name)
Constructor.
isArray()
[Abstract] Gets a value indicating whether this object expresses Array.
toNumber()
[Abstract] Gets a value as integer.
isNull()
[Abstract] Gets a value indicating whether this object is null.
setValue( $arg0=null, $arg1=null)
toString()
[Abstract] Gets a value as string.
__construct( $name)
Constructor.
hasFetchControl()
[Abstract] Gets a value indicating whether this object has a fetch control.
toHTML()
[Abstract] Gets a value as encoded HTML code.
Represents string[] property. XCube_GenericArrayProperty<XCube_StringProperty>.
__construct( $name)
Constructor.
Represents string property.
toNumber()
Gets a value as integer.
Represents string[] property which allows CR and LF. XCube_GenericArrayProperty<XCube_TextProperty>.
__construct( $name)
Constructor.
Represents string property which allows CR and LF.
toNumber()
Gets a value as integer.