コード例 #1
0
ファイル: user.php プロジェクト: DarneoStudio/bitrix
 /**
  * Builds model from \Bitrix\Main\Entity\Result.
  * @param Result $result Query result.
  * @return static
  * @throws \Bitrix\Main\ArgumentException
  */
 public static function buildFromResult(Result $result)
 {
     /** @var Storage $model */
     $model = parent::buildFromResult($result);
     self::$loadedUsers[$model->getId()] = $model;
     return $model;
 }
コード例 #2
0
ファイル: modelbuilder.php プロジェクト: DarneoStudio/bitrix
 public function __construct(Traversable $iterator, $classNameModel)
 {
     parent::__construct($iterator);
     $this->classNameModel = $classNameModel;
     if (!is_subclass_of($classNameModel, Internals\Model::className()) && !in_array(Internals\Model::className(), class_parents($classNameModel))) {
         throw new ObjectException("{$classNameModel} must be subclass of " . Internals\Model::className());
     }
 }
コード例 #3
0
ファイル: sharing.php プロジェクト: mrdeadmouse/u136006
 protected function deleteInternal()
 {
     foreach ($this->getChildren() as $childSharing) {
         $childSharing->deleteInternal();
     }
     unset($childSharing);
     return parent::deleteInternal();
 }
コード例 #4
0
 /**
  * Adds row to entity table, fills error collection and builds model.
  * @param array           $data Data.
  * @param ErrorCollection $errorCollection Error collection.
  * @return \Bitrix\Disk\Internals\Model|static|null
  * @throws \Bitrix\Main\NotImplementedException
  * @internal
  */
 public static function add(array $data, ErrorCollection $errorCollection)
 {
     static::checkRequiredInputParams($data, array('OBJECT_ID', 'ENTITY_ID', 'ENTITY_TYPE', 'MODULE_ID'));
     $model = parent::add($data, $errorCollection);
     if ($model && $model->getCreatedBy()) {
         $driver = Driver::getInstance();
         $driver->getRecentlyUsedManager()->push($model->getCreatedBy(), $model->getObjectId());
     }
     return $model;
 }
コード例 #5
0
 /**
  * Adds row to entity table, fills error collection and builds model.
  * @param array           $data Data.
  * @param ErrorCollection $errorCollection Error collection.
  * @return \Bitrix\Disk\Internals\Model|static|null
  * @throws \Bitrix\Main\NotImplementedException
  * @internal
  */
 public static function add(array $data, ErrorCollection $errorCollection)
 {
     static::checkRequiredInputParams($data, array('OBJECT_ID', 'ENTITY_ID', 'ENTITY_TYPE', 'MODULE_ID'));
     return parent::add($data, $errorCollection);
 }
コード例 #6
0
ファイル: storage.php プロジェクト: DarneoStudio/bitrix
 protected static function prepareGetListParameters(array $parameters)
 {
     if (isset($parameters['filter']['ENTITY_TYPE'])) {
         $parameters['filter']['=ENTITY_TYPE'] = $parameters['filter']['ENTITY_TYPE'];
         unset($parameters['filter']['ENTITY_TYPE']);
     }
     if (isset($parameters['filter']['ENTITY_ID'])) {
         $parameters['filter']['=ENTITY_ID'] = $parameters['filter']['ENTITY_ID'];
         unset($parameters['filter']['ENTITY_ID']);
     }
     if (isset($parameters['filter']['CODE'])) {
         $parameters['filter']['=CODE'] = $parameters['filter']['CODE'];
         unset($parameters['filter']['CODE']);
     }
     if (isset($parameters['filter']['XML_ID'])) {
         $parameters['filter']['=XML_ID'] = $parameters['filter']['XML_ID'];
         unset($parameters['filter']['XML_ID']);
     }
     if (isset($parameters['filter']['MODULE_ID'])) {
         $parameters['filter']['=MODULE_ID'] = $parameters['filter']['MODULE_ID'];
         unset($parameters['filter']['MODULE_ID']);
     }
     return parent::prepareGetListParameters($parameters);
 }
コード例 #7
0
ファイル: externallink.php プロジェクト: mrdeadmouse/u136006
 /**
  * Adds row to entity table, fills error collection and build model.
  * @param array           $data Data.
  * @param ErrorCollection $errorCollection Error collection.
  * @return \Bitrix\Disk\Internals\Model|static|null
  * @throws \Bitrix\Main\NotImplementedException
  * @internal
  */
 public static function add(array $data, ErrorCollection $errorCollection)
 {
     static::checkRequiredInputParams($data, array('OBJECT_ID'));
     if (!empty($data['PASSWORD'])) {
         list($data['PASSWORD'], $data['SALT']) = ExternalLink::generatePasswordAndSalt($data['PASSWORD']);
     }
     $data['HASH'] = md5(uniqid($data['OBJECT_ID'], true) . \CMain::getServerUniqID());
     return parent::add($data, $errorCollection);
 }
コード例 #8
0
ファイル: version.php プロジェクト: mrdeadmouse/u136006
 public function delete()
 {
     $success = parent::deleteInternal();
     if (!$success) {
         return false;
     }
     \CFile::delete($this->fileId);
     return true;
 }