本文整理汇总了PHP中BaseElementModel::defineAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseElementModel::defineAttributes方法的具体用法?PHP BaseElementModel::defineAttributes怎么用?PHP BaseElementModel::defineAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseElementModel
的用法示例。
在下文中一共展示了BaseElementModel::defineAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defineAttributes
/**
* @access protected
* @return array
*/
protected function defineAttributes()
{
// Craft email settings
$settings = craft()->email->getSettings();
$systemEmail = !empty($settings['emailAddress']) ? $settings['emailAddress'] : '';
$systemName = !empty($settings['senderName']) ? $settings['senderName'] : '';
return array_merge(parent::defineAttributes(), array('id' => AttributeType::Number, 'fieldLayoutId' => AttributeType::Number, 'redirectEntryId' => AttributeType::Number, 'name' => AttributeType::String, 'handle' => AttributeType::String, 'titleFormat' => array(AttributeType::String, 'default' => "{dateCreated|date('D, d M Y H:i:s')}"), 'submitAction' => AttributeType::String, 'submitButton' => AttributeType::String, 'afterSubmitText' => AttributeType::Mixed, 'submissionEnabled' => array(AttributeType::Bool, 'default' => true), 'sendCopy' => array(AttributeType::Bool, 'default' => false), 'sendCopyTo' => AttributeType::String, 'notificationEnabled' => array(AttributeType::Bool, 'default' => true), 'notificationFilesEnabled' => array(AttributeType::Bool, 'default' => false), 'notificationRecipients' => array(AttributeType::String, 'default' => $systemEmail), 'notificationSubject' => array(AttributeType::String, 'default' => Craft::t('{formName} form was submitted')), 'notificationSenderName' => array(AttributeType::String, 'default' => $systemName), 'notificationSenderEmail' => array(AttributeType::String, 'default' => $systemEmail), 'notificationReplyToEmail' => array(AttributeType::String, 'default' => $systemEmail), 'formTemplate' => AttributeType::String, 'tabTemplate' => AttributeType::String, 'fieldTemplate' => AttributeType::String, 'notificationTemplate' => AttributeType::String));
}
示例2: defineAttributes
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('customerName' => array(AttributeType::String, 'required' => true, 'label' => 'Name'), 'customerEmail' => array(AttributeType::Email, 'required' => true, 'label' => 'Email'), 'cardToken' => array(AttributeType::String, 'required' => true, 'label' => 'Stripe Card Token'), 'cardName' => array(AttributeType::String, 'label' => 'Cardholder Name'), 'cardAddressLine1' => array(AttributeType::String, 'label' => 'Card Address 1'), 'cardAddressLine2' => array(AttributeType::String, 'label' => 'Card Address 2'), 'cardAddressCity' => array(AttributeType::String, 'label' => 'Card Address City'), 'cardAddressState' => array(AttributeType::String, 'label' => 'Card Address State'), 'cardAddressZip' => array(AttributeType::String, 'label' => 'Card Address Zip'), 'cardAddressCountry' => array(AttributeType::String, 'label' => 'Card Address Country'), 'cardLast4' => array(AttributeType::String, 'label' => 'Card Last 4'), 'cardType' => array(AttributeType::String, 'label' => 'Card Type'), 'cardExpMonth' => array(AttributeType::String, 'label' => 'Card Expiry Month'), 'cardExpYear' => array(AttributeType::String, 'label' => 'Card Expiry Year'), 'planAmount' => array(AttributeType::Number, 'required' => true, 'label' => 'Amount', 'decimals' => 2), 'planCurrency' => array(AttributeType::String, 'label' => 'Currency'), 'planInterval' => array(AttributeType::String, 'label' => 'Plan Interval'), 'planIntervalCount' => array(AttributeType::Number, 'label' => 'Plan Interval Count'), 'planType' => array(AttributeType::Enum, 'values' => 'charge, recuring', 'label' => 'Plan Type'), 'planName' => array(AttributeType::String), 'planCoupon' => array(AttributeType::String), 'planCouponStripeId' => array(AttributeType::String), 'planDiscount' => array(AttributeType::Number), 'planFullAmount' => array(AttributeType::Number), 'hasDiscount' => array(AttributeType::Bool, 'label' => 'Has a Discount?'), 'description' => array(AttributeType::String, 'label' => 'Description'), 'hash' => array(AttributeType::String, 'label' => 'Hash'), 'stripe' => array(AttributeType::String, 'label' => 'Stripe Data'), 'mode' => array(AttributeType::Enum, 'values' => 'test,live', 'label' => 'Transaction Mode'), 'sourceUrl' => array(AttributeType::Url, 'label' => 'Source URL'), 'userId' => array(AttributeType::Number, 'label' => 'User ID'), 'timestamp' => array(AttributeType::DateTime, 'label' => 'Time'), 'notes' => array(AttributeType::String), 'stripeCustomerId' => array(AttributeType::String), 'stripeChargeId' => array(AttributeType::String), 'meta' => array(AttributeType::Mixed), 'stripeAccountBalance' => array(AttributeType::Number, 'label' => 'Account Balance')));
}
示例3: defineAttributes
/**
* @access protected
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('locale' => array(AttributeType::String, 'default' => craft()->language), 'elementId' => array(AttributeType::Number, 'default' => 0), 'metaType' => array(AttributeType::Enum, 'values' => "default,template", 'default' => 'template'), 'metaPath' => array(AttributeType::String, 'default' => ''), 'seoMainEntityCategory' => array(AttributeType::String, 'default' => 'CreativeWork'), 'seoMainEntityOfPage' => array(AttributeType::String, 'default' => 'WebPage'), 'seoTitle' => array(AttributeType::String, 'default' => ''), 'seoDescription' => array(AttributeType::String, 'default' => ''), 'seoKeywords' => array(AttributeType::String, 'default' => ''), 'seoImageTransform' => array(AttributeType::String, 'default' => ''), 'seoFacebookImageTransform' => array(AttributeType::String, 'default' => ''), 'seoTwitterImageTransform' => array(AttributeType::String, 'default' => ''), 'twitterCardType' => array(AttributeType::String, 'default' => ''), 'openGraphType' => array(AttributeType::String, 'default' => ''), 'robots' => array(AttributeType::String, 'default' => ''), 'seoImageId' => array(AttributeType::Number, 'default' => null), 'seoTwitterImageId' => array(AttributeType::Number, 'default' => null), 'seoFacebookImageId' => array(AttributeType::Number, 'default' => null)));
}
示例4: defineAttributes
/**
* @inheritDoc BaseModel::defineAttributes()
*
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('sourceId' => AttributeType::Number, 'folderId' => AttributeType::Number, 'filename' => AttributeType::String, 'originalName' => AttributeType::String, 'kind' => AttributeType::String, 'width' => AttributeType::Number, 'height' => AttributeType::Number, 'size' => AttributeType::Number, 'dateModified' => AttributeType::DateTime));
}
示例5: defineAttributes
/**
* @inheritDoc BaseModel::defineAttributes()
*
* @return array
*/
protected function defineAttributes()
{
$requireUsername = !craft()->config->get('useEmailAsUsername');
return array_merge(parent::defineAttributes(), array('username' => array(AttributeType::String, 'maxLength' => 100, 'required' => $requireUsername), 'photo' => array(AttributeType::String, 'maxLength' => 100), 'firstName' => AttributeType::String, 'lastName' => AttributeType::String, 'email' => array(AttributeType::Email, 'required' => !$requireUsername), 'password' => AttributeType::String, 'preferredLocale' => AttributeType::Locale, 'weekStartDay' => array(AttributeType::Number, 'default' => craft()->config->get('defaultWeekStartDay')), 'admin' => AttributeType::Bool, 'client' => AttributeType::Bool, 'locked' => AttributeType::Bool, 'suspended' => AttributeType::Bool, 'pending' => AttributeType::Bool, 'archived' => AttributeType::Bool, 'lastLoginDate' => AttributeType::DateTime, 'invalidLoginCount' => AttributeType::Number, 'lastInvalidLoginDate' => AttributeType::DateTime, 'lockoutDate' => AttributeType::DateTime, 'passwordResetRequired' => AttributeType::Bool, 'lastPasswordChangeDate' => AttributeType::DateTime, 'unverifiedEmail' => AttributeType::Email, 'newPassword' => AttributeType::String, 'currentPassword' => AttributeType::String, 'verificationCodeIssuedDate' => AttributeType::DateTime));
}
示例6: defineAttributes
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('id' => array(AttributeType::Number), 'elementId' => array(AttributeType::Number, 'required' => true), 'elementType' => array(AttributeType::String, 'required' => true), 'listId' => array(AttributeType::Number), 'listName' => array('AttrributeType::String', 'required' => true), 'public' => array(AttributeType::Bool, 'default' => true), 'type' => array(AttributeType::String, 'label' => 'Item Type'), 'sortOrder' => array(AttributeType::Number), 'inList' => array(AttributeType::Bool, 'required' => true, 'default' => false), 'otherLists' => array(AttributeType::Mixed)));
}
示例7: defineAttributes
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('eid' => AttributeType::Number, 'eventid' => AttributeType::Number, 'startDate' => AttributeType::DateTime, 'order' => array(AttributeType::String, 'default' => 'venti.startDate asc'), 'endDate' => AttributeType::DateTime, 'allDay' => AttributeType::Number, 'repeat' => AttributeType::Number, 'rRule' => AttributeType::String, 'summary' => AttributeType::String, 'isrepeat' => AttributeType::Number, 'locale' => AttributeType::String, 'postDate' => AttributeType::DateTime, 'expiryDate' => AttributeType::DateTime));
}
示例8: defineAttributes
/**
* @access protected
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('id' => AttributeType::Number, 'groupId' => AttributeType::Number, 'fieldLayoutId' => AttributeType::Number, 'name' => AttributeType::String, 'handle' => AttributeType::String, 'titleFormat' => AttributeType::String, 'displaySectionTitles' => array(AttributeType::Bool, 'default' => false), 'redirectUri' => AttributeType::String, 'submitAction' => AttributeType::String, 'submitButtonText' => AttributeType::String, 'notificationEnabled' => array(AttributeType::Bool, 'default' => false), 'notificationRecipients' => AttributeType::String, 'notificationSubject' => AttributeType::String, 'notificationSenderName' => AttributeType::String, 'notificationSenderEmail' => AttributeType::String, 'notificationReplyToEmail' => AttributeType::String, 'ownerId' => AttributeType::Number, 'oldHandle' => AttributeType::String));
}
示例9: defineAttributes
/**
* Return the model's attributes.
*
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('id' => AttributeType::Number, 'type' => AttributeType::String, 'userId' => AttributeType::Number, 'origin' => AttributeType::String, 'before' => AttributeType::Mixed, 'after' => AttributeType::Mixed, 'diff' => AttributeType::Mixed, 'status' => AttributeType::String));
}
示例10: defineAttributes
/**
* @return array
*/
protected function defineAttributes()
{
$defaults = parent::defineAttributes();
$attributes = array('subjectLine' => array(AttributeType::String, 'required' => true), 'campaignId' => array(AttributeType::Number, 'required' => true), 'recipients' => array(AttributeType::Mixed, 'required' => false), 'fromName' => array(AttributeType::String, 'minLength' => 2, 'maxLength' => 100, 'required' => false), 'fromEmail' => array(AttributeType::String, 'minLength' => 6, 'required' => false), 'replyTo' => array(AttributeType::String, 'required' => false), 'sent' => AttributeType::Bool, 'recipientLists' => Attributetype::Mixed);
return array_merge($defaults, $attributes);
}
示例11: defineAttributes
/**
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('appId' => AttributeType::Number, 'title' => AttributeType::Name, 'body' => AttributeType::String, 'command' => AttributeType::String, 'schedule' => array(AttributeType::DateTime, 'default' => DateTimeHelper::currentUTCDateTime())));
}
示例12: defineAttributes
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('id' => AttributeType::Number, 'ip' => AttributeType::String, 'formId' => AttributeType::Number, 'title' => AttributeType::String, 'data' => AttributeType::Mixed));
}
示例13: defineAttributes
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('id' => array(AttributeType::Number), 'elementId' => array(AttributeType::Number), 'elementType' => array(AttributeType::String), 'userId' => array(AttributeType::Number), 'structureId' => array(AttributeType::Number), 'status' => array(AttributeType::Enum, 'values' => array(Comments_CommentModel::APPROVED, Comments_CommentModel::PENDING, Comments_CommentModel::SPAM, Comments_CommentModel::TRASHED)), 'name' => array(AttributeType::String), 'email' => array(AttributeType::Email), 'url' => array(AttributeType::Url), 'ipAddress' => array(AttributeType::String), 'userAgent' => array(AttributeType::String), 'comment' => array(AttributeType::String), 'rating' => array(AttributeType::String), 'parentId' => AttributeType::Number));
}
示例14: defineAttributes
/**
* @access protected
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('setId' => AttributeType::Number, 'name' => AttributeType::String));
}
示例15: defineAttributes
/**
* @access protected
* @return array
*/
protected function defineAttributes()
{
return array_merge(parent::defineAttributes(), array('locale' => array(AttributeType::String, 'default' => craft()->language), 'elementId' => array(AttributeType::Number, 'default' => 0), 'metaType' => array(AttributeType::Enum, 'values' => "default,template", 'default' => 'template'), 'metaPath' => array(AttributeType::String, 'default' => ''), 'seoTitle' => array(AttributeType::String, 'default' => ''), 'seoDescription' => array(AttributeType::String, 'default' => ''), 'seoKeywords' => array(AttributeType::String, 'default' => ''), 'twitterCardType' => array(AttributeType::String, 'default' => ''), 'openGraphType' => array(AttributeType::String, 'default' => ''), 'robots' => array(AttributeType::String, 'default' => ''), 'seoImageId' => array(AttributeType::Number, 'default' => 0)));
}