本文整理汇总了PHP中Company::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::getId方法的具体用法?PHP Company::getId怎么用?PHP Company::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Company
的用法示例。
在下文中一共展示了Company::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildForm
/**
* Form builder
*
* @param FormBuilderInterface $builder
* @param array $options
*
* @return null
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$this->company = $options['company'];
if (null == $this->company) {
$builder->add('company', EntityType::class, array('label' => 'Docgroupcomptable.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
}, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
$builder->add('parent', EntityType::class, array('label' => 'Docgroupcomptable.parent.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) {
return $dgr->createQueryBuilder('d')->orderBy('d.pageUrlFull', 'ASC');
}, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
$builder->add('clone', EntityType::class, array('label' => 'Docgroup.clone.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) {
return $dgr->createQueryBuilder('d')->orderBy('d.pageUrlFull', 'ASC');
}, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'mapped' => false));
} else {
$companyId = $this->company->getId();
$builder->add('company', EntityidType::class, array('label' => 'Docgroupcomptable.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
}, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
$builder->add('parent', EntityType::class, array('label' => 'Docgroupcomptable.parent.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) use($companyId) {
return $dgr->createQueryBuilder('d')->join('d.company', 'c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('d.pageUrlFull', 'ASC');
}, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
$builder->add('clone', EntityType::class, array('label' => 'Docgroup.clone.label', 'class' => 'AcfDataBundle:Docgroupcomptable', 'query_builder' => function (DocgroupcomptableRepository $dgr) use($companyId) {
return $dgr->createQueryBuilder('d')->join('d.company', 'c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('d.pageUrlFull', 'ASC');
}, 'choice_label' => 'pageUrlFull', 'multiple' => false, 'by_reference' => true, 'required' => false, 'placeholder' => 'Options.choose', 'mapped' => false));
}
$builder->add('label', TextType::class, array('label' => 'Docgroupcomptable.label.label'));
$builder->add('otherInfos', TextareaType::class, array('label' => 'Docgroupcomptable.otherInfos.label', 'required' => false));
}
示例2: buildForm
/**
* Form builder
*
* @param FormBuilderInterface $builder
* @param array $options
*
* @return null
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$this->company = $options['company'];
if (null == $this->company) {
$builder->add('company', EntityType::class, array('label' => 'Address.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
}, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
} else {
$companyId = $this->company->getId();
$builder->add('company', EntityidType::class, array('label' => 'Address.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
}, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
}
$builder->add('label', TextType::class, array('label' => 'Address.label.label'));
$builder->add('streetNum', IntegerType::class, array('label' => 'Address.streetNum.label', 'scale' => 0, 'required' => false));
$builder->add('address', TextareaType::class, array('label' => 'Address.address.label', 'required' => false));
$builder->add('address2', TextareaType::class, array('label' => 'Address.address2.label', 'required' => false));
$builder->add('town', TextType::class, array('label' => 'Address.town.label', 'required' => false));
$builder->add('zipCode', TextType::class, array('label' => 'Address.zipCode.label', 'required' => false));
$builder->add('country', CountryType::class, array('label' => 'Address.country.label', 'required' => false, 'placeholder' => 'Options.choose', 'empty_data' => null));
$builder->add('email', EmailType::class, array('label' => 'Address.email.label', 'required' => false));
$builder->add('phone', TextType::class, array('label' => 'Address.phone.label', 'required' => false));
$builder->add('mobile', TextType::class, array('label' => 'Address.mobile.label', 'required' => false));
$builder->add('fax', TextType::class, array('label' => 'Address.fax.label', 'required' => false));
$builder->add('otherInfos', TextareaType::class, array('label' => 'Address.otherInfos.label', 'required' => false));
}
示例3: buildForm
/**
* Form builder
*
* @param FormBuilderInterface $builder
* @param array $options
*
* @return null
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$this->company = $options['company'];
if (null == $this->company) {
$builder->add('company', EntityType::class, array('label' => 'CompanyFrame.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) {
return $br->createQueryBuilder('c')->orderBy('c.corporateName', 'ASC');
}, 'choice_label' => 'corporateName', 'multiple' => false, 'by_reference' => true, 'required' => true));
} else {
$companyId = $this->company->getId();
$builder->add('company', EntityidType::class, array('label' => 'CompanyFrame.company.label', 'class' => 'AcfDataBundle:Company', 'query_builder' => function (CompanyRepository $br) use($companyId) {
return $br->createQueryBuilder('c')->where('c.id = :id')->setParameter('id', $companyId)->orderBy('c.corporateName', 'ASC');
}, 'choice_label' => 'id', 'multiple' => false, 'by_reference' => true, 'required' => true));
}
$builder->add('year', IntegerType::class, array('label' => 'MBSale.year.label'));
}
示例4: updateCompany
public function updateCompany(Company $company)
{
$result = $this->companyDao->get($company->getId());
ResultHelper::whenEmpty($result, AppLabelUtil::$ERROR_COMPANY_NOT_FOUND, HttpStatusCode::badRequest());
$company->setStatus($this->validateStatus($company->getStatus()));
$this->companyDao->update($company);
}
示例5: getTableName
protected function getTableName()
{
return Company::getId() . '_ProjectMessages';
/*$campaign = Company::search_by_domain($_SERVER['SERVER_NAME']);
if ($campaign->id) {
return '`'.$campaign->id.'_ProjectMessages`';
} else {
return "`ProjectMessages`";
}*/
}
示例6: filterLogin
public function filterLogin($filterChain)
{
$id = Company::getId();
if (empty($id)) {
throw new RuntimeException('非法访问');
}
$this->comId = $id;
$this->comName = Company::getName();
return $filterChain->run();
}
示例7: mapCompanyToDto
public function mapCompanyToDto(Company $company)
{
$companyDto = new CompanyDto();
$companyDto->setId($company->getId());
$companyDto->setName($company->getName());
$companyDto->setContactName($company->getContactName());
$companyDto->setEmail($company->getEmail());
$companyDto->setPhoneNumber($company->getPhoneNumber());
$companyDto->setRegion($company->getRegion());
$companyDto->setWebsite($company->getWebsite());
$companyDto->setStatus($company->getStatus());
return $companyDto;
}
示例8: actionUpload
public function actionUpload()
{
if ($_GET['id']) {
$id = intval($_GET['id']);
}
if ($_GET['unixtime']) {
$unixtime = intval($_GET['unixtime']);
}
$folder = Yii::getPathOfAlias('webroot') . '/uploads/c' . Company::getId();
if ($id) {
$folder .= '/' . $id . '/';
} else {
$folder .= '/temp/' . $unixtime . '/';
}
$result = Tools::uploadMaterials($folder);
echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
if ($id && $result['success'] && User::model()->isCustomer()) {
EventHelper::materialsAdded($id);
}
}
示例9: setCompany
/**
* Declares an association between this object and a Company object.
*
* @param Company $v
* @return Element The current object (for fluent API support)
* @throws PropelException
*/
public function setCompany(Company $v = null)
{
if ($v === null) {
$this->setCompanyId(NULL);
} else {
$this->setCompanyId($v->getId());
}
$this->aCompany = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Company object, it will not be re-added.
if ($v !== null) {
$v->addElement($this);
}
return $this;
}
示例10: tableName
public function tableName()
{
return Company::getId() . '_' . 'Profiles';
//Yii::app()->getModule('user')->tableProfiles;
}
示例11: isCompanyManager
/**
* Check if this user is manager of a given company
*
* If $company is missing user will be checked agains his own company
*
* @param Company $company
* @return boolean
*/
function isCompanyManager($company)
{
if ($this->isAdministrator() || $this->isPeopleManager()) {
return true;
}
// if
return $this->getCompanyId() == $company->getId() && $this->getSystemPermission('manage_company_details');
}
示例12: array
<?php
/* @var $this ZakazController */
/* @var $model Zakaz */
$this->breadcrumbs = array(ProjectModule::t('Zakazs') => array('index'), ProjectModule::t('List'));
?>
<h1><?php
echo ProjectModule::t('Zakazs');
?>
</h1>
<h1 class='projects-title'><?php
echo ProjectModule::t('SelectProject');
?>
</h1>
<?php
if (Company::getId()) {
$columns = array('id', 'title');
if (ProjectField::model()->inTableByVarname('specials')) {
$columns[] = array('name' => 'specials', 'filter' => Catalog::getAll('specials'), 'value' => '$data->catalog_specials->cat_name');
}
if (ProjectField::model()->inTableByVarname('specials2')) {
$columns[] = array('name' => 'specials2', 'filter' => Catalog::getAll('specials2'), 'value' => '$data->catalog_specials2->cat_name');
}
$columns[] = 'closestDate';
if (!isset($only_new)) {
$columns[] = ['name' => 'executor_event', 'value' => '$data->getExecutorEvents()', 'type' => 'raw'];
}
}
if (User::model()->isCorrector() && $tech) {
$url = Yii::app()->createUrl('/project/chat', array('role' => 'Corrector', 'orderId' => ''));
} elseif (isset($only_new)) {
示例13: isCompanyAdmin
/**
* Check if this user is company administration (used to check many other permissions). User must
* be part of the company and have is_admin stamp set to true
*
* @access public
* @param Company $company
* @return boolean
*/
function isCompanyAdmin(Company $company) {
return ($this->getCompanyId() == $company->getId()) && $this->getIsAdmin();
} // isCompanyAdmin
示例14: tableName
/**
* @return string the associated database table name
*/
public function tableName()
{
return Company::getId() . '_AuthAssignment';
//return 'AuthAssignment';
}
示例15: foreach
$payFieldsUser = $data->profileUser;
foreach ($payFields as $field) {
$fields[] = $field->varname;
$final[$field->varname] = $field->title;
}
$fields = implode($fields, ',');
$userPayFields = Profile::model()->find(array('select' => $fields, 'condition' => 'user_id = :user', 'params' => array(':user' => $data->profileUser->id)));
$fields = array();
if (!empty($userPayFields)) {
foreach ($userPayFields as $key => $field) {
if ($field != null) {
$fields[$key] = $final[$key];
}
}
}
$model = Company::model()->findByPk(Company::getId());
if ($model !== null && $model->PaymentCash == '1') {
$fields['cash'] = 'Наличные';
}
return CHtml::dropDownList('paymentType_' . $data->id, $data->details_type, $fields, array('empty' => '', 'disabled' => in_array($data->approve, array(Payment::APPROVED, Payment::REJECTED)) ? true : false, 'ajax' => array('url' => PaymentController::createUrl('getPayNumber'), 'data' => array('payType' => 'js:this.value', 'user' => $data->profileUser->id), 'success' => 'function(html) {
if (html != "") $("#payDetailNumber_' . $data->id . '").val(html);
else $("#payDetailNumber_' . $data->id . '").val("");
}')));
}), array('name' => 'details_number', 'type' => 'raw', 'value' => function ($data) {
return CHtml::textField("payDetailNumber_{$data->id}", $data->details_number, array('disabled' => in_array($data->approve, array(Payment::APPROVED, Payment::REJECTED)) ? true : false));
}), array('name' => 'approve', 'type' => 'raw', 'value' => function ($data) {
return approve_buttons($data);
}, 'filter' => array('0' => Yii::t('site', 'New'), '1' => Yii::t('site', 'Confirmed'), '2' => Yii::t('site', 'Rejected'))), array('header' => 'Отменить платеж', 'class' => 'CButtonColumn', 'template' => '{cancel}', 'buttons' => array('cancel' => array('label' => Yii::t('site', 'Cancel'), 'options' => array("class" => "btn btn-primary btn-xs cancel_payment"), 'visible' => 'in_array($data->approve, array(' . Payment::APPROVED . ', ' . Payment::REJECTED . '))', 'click' => 'function(){cancelPayment($(this).attr("href"));return false;}', 'url' => '$data->id'))))));
?>
Количество: <b><?php
echo $data['out']['count'];