Exemple #1
0
		/// <summary>
		/// Used by full reflection.
		/// </summary>
		public PhpField(VariableName name, DPropertyDesc/*!*/ fieldDesc, FieldInfo/*!*/ fieldInfo,
			PropertyInfo exportedProperty)
			: base(fieldDesc, name)
		{
			Debug.Assert(fieldDesc is DPhpFieldDesc);

			this.realField = fieldInfo;
			this.exportedProperty = exportedProperty;
			this.hasInitialValue = realField.IsDefined(typeof(PhpHasInitValueAttribute), false);
			this.builder = null;

			this.implementor = DeclaringPhpType;
		}
Exemple #2
0
		/// <summary>
		/// Used by full reflection for fields that are not implemented by their declaring type.
		/// <seealso cref="PhpPublicFieldAttribute"/>
		/// </summary>
		public PhpField(VariableName name, DPropertyDesc/*!*/ fieldDesc, DPropertyDesc/*!*/ implementingFieldDesc,
			bool hasInitialValue, PropertyInfo exportedProperty)
			: base(fieldDesc, name)
		{
			Debug.Assert(fieldDesc is DPhpFieldDesc);

			this.realField = implementingFieldDesc.PhpField.RealField;
			this.exportedProperty = exportedProperty;
			this.hasInitialValue = hasInitialValue;
			this.builder = null;

			this.implementor = implementingFieldDesc.DeclaringType.PhpType;
			this.upgradesVisibility = (IsPublic && implementingFieldDesc.IsProtected);
		}
Exemple #3
0
		/// <summary>
		/// Used by compiler.
		/// </summary>
		public PhpField(VariableName name, DTypeDesc/*!*/ declaringType, PhpMemberAttributes memberAttributes,
			bool hasInitialValue, SourceUnit/*!*/ sourceUnit, Position position)
			: base(new DPhpFieldDesc(declaringType, memberAttributes), name)
		{
			this.hasInitialValue = hasInitialValue;
			this.position = position;
			this.sourceUnit = sourceUnit;
			this.builder = new PhpFieldBuilder(this);
		}