diff --git a/src/Database/Table.php b/src/Database/Table.php index 6a12b4d..9776fba 100644 --- a/src/Database/Table.php +++ b/src/Database/Table.php @@ -160,6 +160,24 @@ public function __construct() { } } + /** + * Compatibility for clone() method for PHP versions less than 7.0. + * + * See: https://github.com/sugarcalendar/core/issues/105 + * + * This shim will be removed at a later date. + * + * @since 2.0.20 + * + * @param string $function + * @param array $args + */ + public function __call( $function = '', $args = array() ) { + if ( 'clone' === $function ) { + call_user_func_array( array( $this, '_clone' ), $args ); + } + } + /** Abstract **************************************************************/ /** @@ -488,7 +506,7 @@ public function delete_all() { * * @return bool */ - public function clone( $new_table_name = '' ) { + public function _clone( $new_table_name = '' ) { // Get the database interface $db = $this->get_db();