diff options
Diffstat (limited to 'framework/Data/ActiveRecord')
7 files changed, 132 insertions, 94 deletions
diff --git a/framework/Data/ActiveRecord/Exceptions/TActiveRecordConfigurationException.php b/framework/Data/ActiveRecord/Exceptions/TActiveRecordConfigurationException.php new file mode 100644 index 00000000..a1c07b8c --- /dev/null +++ b/framework/Data/ActiveRecord/Exceptions/TActiveRecordConfigurationException.php @@ -0,0 +1,22 @@ +<?php +/** + * TActiveRecordException class file. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Data.ActiveRecord + */ + +/** + * TActiveRecordConfigurationException class. + * + * @author Wei Zhuo <weizho[at]gmail[dot]com> + * @package System.Data.ActiveRecord + * @since 3.1 + */ +class TActiveRecordConfigurationException extends TActiveRecordException +{ + +}
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php index 11fb796b..a252631c 100644 --- a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php +++ b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php @@ -30,17 +30,4 @@ class TActiveRecordException extends TDbException $msgFile=$path.'/messages.txt'; return $msgFile; } -} - -/** - * TActiveRecordConfigurationException class. - * - * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @package System.Data.ActiveRecord - * @since 3.1 - */ -class TActiveRecordConfigurationException extends TActiveRecordException -{ - -} - +}
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/Scaffold/IScaffoldEditRenderer.php b/framework/Data/ActiveRecord/Scaffold/IScaffoldEditRenderer.php new file mode 100644 index 00000000..e7f85065 --- /dev/null +++ b/framework/Data/ActiveRecord/Scaffold/IScaffoldEditRenderer.php @@ -0,0 +1,31 @@ +<?php +/** + * TScaffoldEditView class and IScaffoldEditRenderer interface file. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Data.ActiveRecord.Scaffold + */ + +/** + * IScaffoldEditRenderer interface. + * + * IScaffoldEditRenderer defines the interface that an edit renderer + * needs to implement. Besides the {@link getData Data} property, an edit + * renderer also needs to provide {@link updateRecord updateRecord} method + * that is called before the save() method is called on the TActiveRecord. + * + * @author Wei Zhuo <weizho[at]gmail[dot]com> + * @package System.Data.ActiveRecord.Scaffold + * @since 3.1 + */ +interface IScaffoldEditRenderer extends IDataRenderer +{ + /** + * This method should update the record with the user input data. + * @param TActiveRecord record to be saved. + */ + public function updateRecord($record); +}
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php index 74e79eaa..592c958a 100644 --- a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php +++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php @@ -281,26 +281,4 @@ class TScaffoldEditView extends TScaffoldBase { return 'group_'.$this->getUniqueID(); } -} - -/** - * IScaffoldEditRenderer interface. - * - * IScaffoldEditRenderer defines the interface that an edit renderer - * needs to implement. Besides the {@link getData Data} property, an edit - * renderer also needs to provide {@link updateRecord updateRecord} method - * that is called before the save() method is called on the TActiveRecord. - * - * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @package System.Data.ActiveRecord.Scaffold - * @since 3.1 - */ -interface IScaffoldEditRenderer extends IDataRenderer -{ - /** - * This method should update the record with the user input data. - * @param TActiveRecord record to be saved. - */ - public function updateRecord($record); -} - +}
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index 735579cd..5e4755d6 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -1046,60 +1046,4 @@ abstract class TActiveRecord extends TComponent public function toJSON(){ return json_encode($this->toArray()); } -} - -/** - * TActiveRecordChangeEventParameter class - * - * TActiveRecordChangeEventParameter encapsulates the parameter data for - * ActiveRecord change commit events that are broadcasted. The following change events - * may be raise: {@link TActiveRecord::OnInsert}, {@link TActiveRecord::OnUpdate} and - * {@link TActiveRecord::OnDelete}. The {@link setIsValid IsValid} parameter can - * be set to false to prevent the requested change event to be performed. - * - * @author Wei Zhuo<weizhuo@gmail.com> - * @package System.Data.ActiveRecord - * @since 3.1.2 - */ -class TActiveRecordChangeEventParameter extends TEventParameter -{ - private $_isValid=true; - - /** - * @return boolean whether the event should be performed. - */ - public function getIsValid() - { - return $this->_isValid; - } - - /** - * @param boolean set to false to prevent the event. - */ - public function setIsValid($value) - { - $this->_isValid = TPropertyValue::ensureBoolean($value); - } -} - -/** - * TActiveRecordInvalidFinderResult class. - * TActiveRecordInvalidFinderResult defines the enumerable type for possible results - * if an invalid {@link TActiveRecord::__call magic-finder} invoked. - * - * The following enumerable values are defined: - * - Null: return null (default) - * - Exception: throws a TActiveRecordException - * - * @author Yves Berkholz <godzilla80@gmx.net> - * @package System.Data.ActiveRecord - * @see TActiveRecordManager::setInvalidFinderResult - * @see TActiveRecordConfig::setInvalidFinderResult - * @see TActiveRecord::setInvalidFinderResult - * @since 3.1.5 - */ -class TActiveRecordInvalidFinderResult extends TEnumerable -{ - const Null = 'Null'; - const Exception = 'Exception'; -} +}
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/TActiveRecordChangeEventParameter.php b/framework/Data/ActiveRecord/TActiveRecordChangeEventParameter.php new file mode 100644 index 00000000..f1307529 --- /dev/null +++ b/framework/Data/ActiveRecord/TActiveRecordChangeEventParameter.php @@ -0,0 +1,44 @@ +<?php +/** + * TActiveRecord, TActiveRecordEventParameter, TActiveRecordInvalidFinderResult class file. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Data.ActiveRecord + */ + +/** + * TActiveRecordChangeEventParameter class + * + * TActiveRecordChangeEventParameter encapsulates the parameter data for + * ActiveRecord change commit events that are broadcasted. The following change events + * may be raise: {@link TActiveRecord::OnInsert}, {@link TActiveRecord::OnUpdate} and + * {@link TActiveRecord::OnDelete}. The {@link setIsValid IsValid} parameter can + * be set to false to prevent the requested change event to be performed. + * + * @author Wei Zhuo<weizhuo@gmail.com> + * @package System.Data.ActiveRecord + * @since 3.1.2 + */ +class TActiveRecordChangeEventParameter extends TEventParameter +{ + private $_isValid=true; + + /** + * @return boolean whether the event should be performed. + */ + public function getIsValid() + { + return $this->_isValid; + } + + /** + * @param boolean set to false to prevent the event. + */ + public function setIsValid($value) + { + $this->_isValid = TPropertyValue::ensureBoolean($value); + } +}
\ No newline at end of file diff --git a/framework/Data/ActiveRecord/TActiveRecordInvalidFinderResult.php b/framework/Data/ActiveRecord/TActiveRecordInvalidFinderResult.php new file mode 100644 index 00000000..1d02f4c8 --- /dev/null +++ b/framework/Data/ActiveRecord/TActiveRecordInvalidFinderResult.php @@ -0,0 +1,32 @@ +<?php +/** + * TActiveRecord, TActiveRecordEventParameter, TActiveRecordInvalidFinderResult class file. + * + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005-2014 PradoSoft + * @license http://www.pradosoft.com/license/ + * @package System.Data.ActiveRecord + */ + +/** + * TActiveRecordInvalidFinderResult class. + * TActiveRecordInvalidFinderResult defines the enumerable type for possible results + * if an invalid {@link TActiveRecord::__call magic-finder} invoked. + * + * The following enumerable values are defined: + * - Null: return null (default) + * - Exception: throws a TActiveRecordException + * + * @author Yves Berkholz <godzilla80@gmx.net> + * @package System.Data.ActiveRecord + * @see TActiveRecordManager::setInvalidFinderResult + * @see TActiveRecordConfig::setInvalidFinderResult + * @see TActiveRecord::setInvalidFinderResult + * @since 3.1.5 + */ +class TActiveRecordInvalidFinderResult extends TEnumerable +{ + const Null = 'Null'; + const Exception = 'Exception'; +}
\ No newline at end of file |