Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
CheckDfldId.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 
7 class CheckDfldid 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 CheckDfldid
20  */
21  function check(array $data, &$doc = null)
22  {
23 
24  $this->folderName = isset($data[1]) ? $data[1] : null;
25  $this->doc = $doc;
26  $this->checkFolder();
27  return $this;
28  }
29  /**
30  * check if it is a folder
31  * @return void
32  */
33  protected function checkFolder()
34  {
35  if ($this->folderName && $this->folderName != 'auto') {
36  $d = new_doc('', $this->folderName);
37  if (!$d->isAlive()) {
38  $this->addError(ErrorCode::getError('DFLD0001', $this->folderName, $this->doc->name));
39  } elseif (!is_a($d, "Dir")) {
40  $this->addError(ErrorCode::getError('DFLD0002', $this->folderName, $this->doc->name));
41  }
42  }
43  }
44 }
static getError($code, $args=null)
Definition: ErrorCode.php:27
$d
Definition: dav.php:77
check(array $data, &$doc=null)
Definition: CheckDfldId.php:21
addError($msg)
Definition: CheckData.php:29
$data
← centre documentaire © anakeen