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