Scoring
This commit is contained in:
parent
27390fce4e
commit
bf821e1cb5
111
library/SdMetier/Scoring/Calcul.php
Normal file
111
library/SdMetier/Scoring/Calcul.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
require_once 'Metier/partenaires/classMPrivileges.php';
|
||||
require_once 'Metier/partenaires/classMMarques.php';
|
||||
require_once 'Metier/partenaires/classMLiens2.php';
|
||||
require_once 'Metier/scores/classMRegression.php';
|
||||
require_once 'Metier/scores/classMSolvabilite.php';
|
||||
require_once 'Metier/scores/classMRatios.php';
|
||||
|
||||
/**
|
||||
* Injection SdMetier_Scoring_Vars
|
||||
*
|
||||
* $this->getVars(name)
|
||||
* $this->setVars(name)
|
||||
* $this->operation(name)
|
||||
*
|
||||
* Les variables doivents être déclarées public pour un accès direct $this->Vars->{var name}
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Injection SdMetier_Scoring_Formule_{version}
|
||||
* Auto-generated class avec
|
||||
* - appel à vars
|
||||
* - appel à operation
|
||||
*
|
||||
* function calc => effectue les opérations de calcul
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Injection SdMetier_Scoring_Comment_{version}
|
||||
* Doit récupérer le contexte de toutes les variables pour générer les commentaires
|
||||
* - Récupération des données d'initialisation
|
||||
* - Récupération du contexte de calcul
|
||||
* - Récupération de Vars
|
||||
* - Formattage
|
||||
*/
|
||||
|
||||
class SdMetier_Scoring_Calcul
|
||||
{
|
||||
|
||||
protected $Vars = null;
|
||||
protected $Formule = null;
|
||||
protected $Comment = null;
|
||||
|
||||
protected $version = '414';
|
||||
protected $niveau = '2';
|
||||
protected $debug = false;
|
||||
protected $db = null;
|
||||
|
||||
public function __construct($siren, $type = 'score', $sourceModif = 'jour')
|
||||
{
|
||||
// --- Commence par une initialisation des variables dans le dictionnaire
|
||||
$this->Vars = new SdMetier_Scoring_Vars();
|
||||
}
|
||||
|
||||
public function setDebug($debug = false)
|
||||
{
|
||||
$this->debug = $debug;
|
||||
}
|
||||
|
||||
public function setDb($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
public function getVars()
|
||||
{
|
||||
return $this->Vars;
|
||||
}
|
||||
|
||||
public function setFormule(SdMetier_Scoring_Formule_Interface $formule)
|
||||
{
|
||||
$this->Formule = $formule;
|
||||
}
|
||||
|
||||
public function setComment(SdMetier_Scoring_Comment_Interface $comment)
|
||||
{
|
||||
$this->Comment = $comment;
|
||||
}
|
||||
|
||||
|
||||
public function exec($comment = false)
|
||||
{
|
||||
// --- Execution des calculs du score
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// --- Commentaires activés
|
||||
if ( $comment === true ) {
|
||||
|
||||
// --- Chargement si nécessaires des commentaires
|
||||
if ( $this->Comment === null ) {
|
||||
|
||||
}
|
||||
|
||||
// --- Chargement si nécessaire des formules
|
||||
if ( $this->Formule === null ) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
6
library/SdMetier/Scoring/Comment/Abstract.php
Normal file
6
library/SdMetier/Scoring/Comment/Abstract.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
abstract class SdMetier_Scoring_Comment_Abstract implements SdMetier_Scoring_Comment_Interface
|
||||
{
|
||||
|
||||
|
||||
}
|
2
library/SdMetier/Scoring/Comment/Interface.php
Normal file
2
library/SdMetier/Scoring/Comment/Interface.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
interface SdMetier_Scoring_Comment_Interface {}
|
1
library/SdMetier/Scoring/Format/Ratio.php
Normal file
1
library/SdMetier/Scoring/Format/Ratio.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
1
library/SdMetier/Scoring/Format/Valeur.php
Normal file
1
library/SdMetier/Scoring/Format/Valeur.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
6
library/SdMetier/Scoring/Formule/Abstract.php
Normal file
6
library/SdMetier/Scoring/Formule/Abstract.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
abstract class SdMetier_Scoring_Formule_Abstract implements SdMetier_Scoring_Formule_Interface
|
||||
{
|
||||
|
||||
|
||||
}
|
2
library/SdMetier/Scoring/Formule/Interface.php
Normal file
2
library/SdMetier/Scoring/Formule/Interface.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
interface SdMetier_Scoring_Formule_Interface {}
|
Loading…
Reference in New Issue
Block a user