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