Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
CheckCvid.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 
7 class CheckCvid extends CheckData
8 {
9  protected $folderName;
10  /**
11  * @var Doc
12  */
13  protected $doc;
14 
15 
16  /**
17  * @param array $data
18  * @param Doc $doc
19  * @return CheckCvid
20  */
21  function check(array $data, &$doc = null)
22  {
23 
24  $this->folderName = $data[1];
25  $this->doc = $doc;
26  $this->checkCv();
27  return $this;
28  }
29  /**
30  * check id it is a search
31  * @return void
32  */
33  protected function checkCv()
34  {
35  if ($this->folderName) {
36  $d = new_doc('', $this->folderName);
37  if (!$d->isAlive()) {
38  $this->addError(ErrorCode::getError('CVID0001', $this->folderName, $this->doc->name));
39  } elseif (!is_a($d, "\\Dcp\\Family\\CVDoc")) {
40  $this->addError(ErrorCode::getError('CVID0002', $this->folderName, $this->doc->name));
41  }
42  }
43  }
44 }
check(array $data, &$doc=null)
Definition: CheckCvid.php:21
static getError($code, $args=null)
Definition: ErrorCode.php:27
$d
Definition: dav.php:77
addError($msg)
Definition: CheckData.php:29
$data
← centre documentaire © anakeen