本文整理汇总了PHP中collection::get_base_id方法的典型用法代码示例。如果您正苦于以下问题:PHP collection::get_base_id方法的具体用法?PHP collection::get_base_id怎么用?PHP collection::get_base_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collection
的用法示例。
在下文中一共展示了collection::get_base_id方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userHasRequestedARegistrationOnCollection
/**
* Tells whether user has ever requested a registration on collection or not.
*
* @param \collection $collection
* @param $userData
*
* @return boolean
*/
private function userHasRequestedARegistrationOnCollection(\collection $collection, $userData)
{
if (null === ($userRegistration = igorw\get_in($userData, [$collection->get_sbas_id(), $collection->get_base_id()]))) {
return false;
}
return !is_null($userRegistration['active']);
}
示例2: isCollectionAvailable
/**
* Returns true if a collection is available given a configuration.
*
* @param \collection $collection
*
* @return Boolean
*/
public function isCollectionAvailable(\collection $collection)
{
if (!$this->isRestricted()) {
return true;
}
$availableCollections = $this->cache->fetch('available_collections_' . $collection->get_databox()->get_sbas_id()) ?: [];
return in_array($collection->get_base_id(), $availableCollections, true);
}
示例3: doResetRightsOnCollection
/**
* Resets admin rights on a collection.
*
* @param \ACL $acl
* @param \collection $collection
*/
private function doResetRightsOnCollection(\ACL $acl, \collection $collection)
{
$baseId = $collection->get_base_id();
$acl->set_limits($baseId, false);
$acl->remove_quotas_on_base($baseId);
$acl->set_masks_on_base($baseId, '0', '0', '0', '0');
$acl->update_rights_to_base($baseId, ['canputinalbum' => '1', 'candwnldhd' => '1', 'candwnldsubdef' => '1', 'nowatermark' => '1', 'candwnldpreview' => '1', 'cancmd' => '1', 'canadmin' => '1', 'canreport' => '1', 'canpush' => '1', 'creationdate' => '1', 'canaddrecord' => '1', 'canmodifrecord' => '1', 'candeleterecord' => '1', 'chgstatus' => '1', 'imgtools' => '1', 'manage' => '1', 'modify_struct' => '1', 'bas_modify_struct' => '1']);
}
示例4: set_collection_order
/**
*
* @param collection $collection
* @param <type> $ordre
* @return appbox
*/
public function set_collection_order(collection $collection, $ordre)
{
$sqlupd = "UPDATE bas SET ord = :ordre WHERE base_id = :base_id";
$stmt = $this->get_connection()->prepare($sqlupd);
$stmt->execute([':ordre' => $ordre, ':base_id' => $collection->get_base_id()]);
$stmt->closeCursor();
$collection->get_databox()->delete_data_from_cache(\databox::CACHE_COLLECTIONS);
return $this;
}
示例5: createEmptyCollectionJob
/**
* Creates a EmptyCollection task given a collection
*
* @param \collection $collection
*
* @return Task
*/
public function createEmptyCollectionJob(\collection $collection)
{
$job = new EmptyCollectionJob($this->translator);
$settings = simplexml_load_string($job->getEditor()->getDefaultSettings());
$settings->bas_id = $collection->get_base_id();
$task = new Task();
$task->setName($job->getName())->setJobId($job->getJobId())->setSettings($settings->asXML())->setPeriod($job->getEditor()->getDefaultPeriod());
$this->om->persist($task);
$this->om->flush();
$this->notify(NotifierInterface::MESSAGE_CREATE);
return $task;
}
示例6: set_order_master
/**
* Sets the user as "order_master" on a collection
*
* @param \collection $collection The collection to apply
* @param Boolean $bool Wheter the user is order master or not
*
* @return ACL
*/
public function set_order_master(\collection $collection, $bool)
{
$sql = 'UPDATE basusr SET order_master = :master
WHERE usr_id = :usr_id AND base_id = :base_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':master' => $bool ? 1 : 0, ':usr_id' => $this->user->getId(), ':base_id' => $collection->get_base_id()]);
$stmt->closeCursor();
return $this;
}
示例7: setCollection
/**
* @param \collection $collection
*
* @return $this
*/
public function setCollection(\collection $collection)
{
$this->baseId = $collection->get_base_id();
return $this;
}
示例8: setCollection
/**
* Sets the collection.
*
* @param \collection $collection
*
* @return void
*/
public function setCollection(\collection $collection = null)
{
if ($collection === null) {
$this->baseId = null;
return;
}
$this->baseId = $collection->get_base_id();
}
示例9: testGet_base_id
public function testGet_base_id()
{
$this->assertTrue(is_int(self::$object->get_base_id()));
$this->assertTrue(self::$object->get_base_id() > 0);
}
示例10: move_to_collection
/**
*
* @param collection $collection
* @param appbox $appbox
* @return record_adapter
*/
public function move_to_collection(collection $collection, appbox $appbox)
{
if ($this->get_collection()->get_base_id() === $collection->get_base_id()) {
return $this;
}
$sql = "UPDATE record SET coll_id = :coll_id WHERE record_id =:record_id";
$params = [':coll_id' => $collection->get_coll_id(), ':record_id' => $this->get_record_id()];
$stmt = $this->get_databox()->get_connection()->prepare($sql);
$stmt->execute($params);
$stmt->closeCursor();
$this->base_id = $collection->get_base_id();
$this->app['phraseanet.SE']->updateRecord($this);
$this->app['phraseanet.logger']($this->get_databox())->log($this, Session_Logger::EVENT_MOVE, $collection->get_coll_id(), '');
$this->delete_data_from_cache();
return $this;
}
示例11: deleteRegistrationsOnCollection
/**
* Deletes registrations on given collection.
*
* @param $baseId
*/
public function deleteRegistrationsOnCollection(\collection $collection)
{
$qb = $this->getRepository()->createQueryBuilder('d');
$qb->delete('Phraseanet:Registration', 'd');
$qb->where($qb->expr()->eq('d.baseId', ':base'));
$qb->setParameter(':base', $collection->get_base_id());
$qb->getQuery()->execute();
}
示例12: list_collection
/**
* Retrieve detailled informations about one collection
*
* @param collection $collection
*
* @return array
*/
private function list_collection(\collection $collection)
{
return ['base_id' => $collection->get_base_id(), 'collection_id' => $collection->get_coll_id(), 'name' => $collection->get_name(), 'labels' => ['fr' => $collection->get_label('fr'), 'en' => $collection->get_label('en'), 'de' => $collection->get_label('de'), 'nl' => $collection->get_label('nl')], 'record_amount' => $collection->get_record_amount()];
}
示例13: list_collection
/**
* Retrieve detailled informations about one collection
*
* @param collection $collection
* @return array
*/
protected function list_collection(collection $collection)
{
$ret = ['base_id' => $collection->get_base_id(), 'collection_id' => $collection->get_coll_id(), 'name' => $collection->get_name(), 'labels' => ['fr' => $collection->get_label('fr'), 'en' => $collection->get_label('en'), 'de' => $collection->get_label('de'), 'nl' => $collection->get_label('nl')], 'record_amount' => $collection->get_record_amount()];
return $ret;
}