70 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
71 $this->DatabaseAlgorithms =
get_package(
'database::database_algorithms' ,
'last' , __FILE__ );
72 $this->Link =
get_package(
'link' ,
'last' , __FILE__ );
73 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
74 $this->SecurityParser =
get_package(
'security::security_parser' ,
'last' , __FILE__ );
110 return( $this->Database->select(
'*' , $this->NativeTable , $Condition ) );
112 catch( Exception $e )
144 $id = $this->Security->get( $id ,
'integer_list' );
146 return( $this->
unsafe_select( $this->NativeTable.
".id IN ( $id ) ORDER BY id DESC" ) );
148 catch( Exception $e )
172 private function rise_create_event( $id )
176 $EventManager =
get_package(
'event_manager' ,
'last' , __FILE__ );
177 $EventManager->trigger_event(
'on_after_create_rating' , array(
'id' => $id ) );
179 catch( Exception $e )
211 $MasterLink = $this->SecurityParser->parse_parameters(
212 $Record ,
'master_type:command;master_id:integer'
215 $Record = array(
'value' => 0 );
217 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
219 $id = $this->DatabaseAlgorithms->create( $this->NativeTable , $Fields , $Values );
223 get_field( $MasterLink ,
'master_id' ) , $id ,
224 get_field( $MasterLink ,
'master_type' ) ,
'rating'
227 $this->rise_create_event( $id );
231 catch( Exception $e )
263 $id = $this->Security->get( $id ,
'integer_list' );
264 $Record = $this->SecurityParser->parse_parameters( $Record ,
'value:float' ,
'allow_not_set' );
266 list( $Fields , $Values ) = $this->DatabaseAlgorithms->compile_fields_values( $Record );
268 if( isset( $Fields[ 0 ] ) )
270 $this->Database->update(
271 $this->NativeTable , $Fields , $Values ,
"( $this->AddLimitations ) AND id IN ( $id )"
273 $this->Database->commit();
276 catch( Exception $e )