Bitrix-D7  20.0.0
addresult.php
См. документацию.
1 <?php
2 /**
3  * Bitrix Framework
4  * @package bitrix
5  * @subpackage main
6  * @copyright 2001-2012 Bitrix
7  */
8 
10 
11 class AddResult extends Result
12 {
13  /** @var array */
14  protected $primary;
15 
16  public function __construct()
17  {
19  }
20 
21  public function setId($id)
22  {
23  $this->primary = array('ID' => $id);
24  }
25 
26  /**
27  * Returns id of added record
28  * @return int|array
29  */
30  public function getId()
31  {
32  if (is_array($this->primary) && count($this->primary) == 1)
33  {
34  return end($this->primary);
35  }
36 
37  return $this->primary;
38  }
39 
40  /**
41  * @param array $primary
42  */
43  public function setPrimary($primary)
44  {
45  $this->primary = $primary;
46  }
47 
48  /**
49  * @return array
50  */
51  public function getPrimary()
52  {
53  return $this->primary;
54  }
55 }
Bitrix\Main\ORM\Data\AddResult\$primary
$primary
Definition: addresult.php:14
Bitrix\Main\ORM\Data\AddResult\setId
setId($id)
Definition: addresult.php:21
Bitrix\Main\ORM\Data
Definition: addresult.php:9
Bitrix\Main\ORM\Data\AddResult\getId
getId()
Returns id of added record.
Definition: addresult.php:30
Bitrix\Sender\Connector\__construct
__construct(Base $connector)
Constructor.
Definition: resultview.php:40
Bitrix\Main\ORM\Data\AddResult\__construct
__construct()
Definition: addresult.php:16
Bitrix\Main\ORM\Data\AddResult\setPrimary
setPrimary($primary)
Definition: addresult.php:43
Bitrix\Main\ORM\Data\Result
Definition: main/lib/orm/data/result.php:15
Bitrix\Main\ORM\Data\AddResult\getPrimary
getPrimary()
Definition: addresult.php:51
Bitrix\Main\ORM\Data\AddResult
Definition: addresult.php:11