diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-11-11 17:19:26 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-11-11 17:19:26 +0100 |
commit | d7f3313ff4514e38c9f53439cd1a1287e56e45f7 (patch) | |
tree | abff39ab11cb317f5fcd2db558da1c59bdae9239 /w/class/modelanalyse.php | |
parent | 2f363e8fa26ab849539e64ff7caa21bd164e8979 (diff) | |
download | wcms-d7f3313ff4514e38c9f53439cd1a1287e56e45f7.tar.gz wcms-d7f3313ff4514e38c9f53439cd1a1287e56e45f7.zip |
reboot folder
Diffstat (limited to 'w/class/modelanalyse.php')
-rw-r--r-- | w/class/modelanalyse.php | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/w/class/modelanalyse.php b/w/class/modelanalyse.php deleted file mode 100644 index 379c41a..0000000 --- a/w/class/modelanalyse.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - - - -class Modelanalyse extends Modelart -{ - - - public function __construct() { - parent::__construct(); - } - - public function analyseall() - { - $artlist = $this->getlister(); - - $artlist2 = []; - foreach ($artlist as $art) { - $art->setlinkfrom($this->analyselinkfrom($art)); - $artlist2[] = $art; - } - foreach ($artlist2 as $art) { - $art->setlinkto($this->analyselinkto($art->id(), $artlist)); - $this->update($art); - } - } - - - public function analyse(Art2 $art) - { - $art->setlinkfrom($this->analyselinkfrom($art)); - - $artlist = $this->getlister(); - $art->setlinkto($this->analyselinkto($art->id(), $artlist)); - - return $art; - } - - - - - public function analyselinkto($id, $artlist) - { - //analyse les liens vers cet article en fouillant tout les linkfrom de la bdd, génere un tableau à stocker dans l'article - $linkto = []; - foreach ($artlist as $link) { - if (in_array($id, $link->linkfrom('array')) && $id != $link->id()) { - $linkto[] = $link->id(); - } - } - return $linkto; - } - - public function analyselinkfrom(Art2 $art) - { - $linkfrom = []; - foreach (self::TEXT_ELEMENTS as $element) { - preg_match_all('#\]\((\?id=|=)(\w+)\)#', $art->$element(), $out); - $linkfrom = array_merge($linkfrom, $out[2]); - } - return array_unique($linkfrom); - - } - -} - - - - - - - -?>
\ No newline at end of file |