Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 7.1.0

Conflicts:
	src/Umbraco.Core/Services/IRelationService.cs
	src/Umbraco.Web/Models/PublishedProperty.cs
	src/Umbraco.Web/PublishedCache/MemberPublishedContent.cs
This commit is contained in:
Sebastiaan Janssen
2014-04-03 11:13:13 +02:00
2 changed files with 113 additions and 1 deletions

View File

@@ -63,6 +63,21 @@ namespace Umbraco.Core.Services
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
IEnumerable<IRelation> GetByParentId(int id);
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their parent entity
/// </summary>
/// <param name="parent">Parent Entity to retrieve relations for</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
IEnumerable<IRelation> GetByParent(IUmbracoEntity parent);
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their parent entity
/// </summary>
/// <param name="parent">Parent Entity to retrieve relations for</param>
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
IEnumerable<IRelation> GetByParent(IUmbracoEntity parent, string relationTypeAlias);
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child Id
/// </summary>
@@ -70,6 +85,21 @@ namespace Umbraco.Core.Services
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
IEnumerable<IRelation> GetByChildId(int id);
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child Entity
/// </summary>
/// <param name="child">Child Entity to retrieve relations for</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
IEnumerable<IRelation> GetByChild(IUmbracoEntity child);
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child Entity
/// </summary>
/// <param name="child">Child Entity to retrieve relations for</param>
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
IEnumerable<IRelation> GetByChild(IUmbracoEntity child, string relationTypeAlias);
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child or parent Id.
/// Using this method will get you all relations regards of it being a child or parent relation.
@@ -190,6 +220,23 @@ namespace Umbraco.Core.Services
/// <returns>Returns <c>True</c> if any relations exists with the given Ids, otherwise <c>False</c></returns>
bool AreRelated(int parentId, int childId);
/// <summary>
/// Checks whether two items are related
/// </summary>
/// <param name="parent">Parent entity</param>
/// <param name="child">Child entity</param>
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child);
/// <summary>
/// Checks whether two items are related
/// </summary>
/// <param name="parent">Parent entity</param>
/// <param name="child">Child entity</param>
/// <param name="relationTypeAlias">Alias of the type of relation to create</param>
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias);
/// <summary>
/// Saves a <see cref="Relation"/>
/// </summary>

View File

@@ -128,6 +128,27 @@ namespace Umbraco.Core.Services
}
}
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their parent entity
/// </summary>
/// <param name="parent">Parent Entity to retrieve relations for</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
public IEnumerable<IRelation> GetByParent(IUmbracoEntity parent)
{
return GetByParentId(parent.Id);
}
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their parent entity
/// </summary>
/// <param name="parent">Parent Entity to retrieve relations for</param>
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
public IEnumerable<IRelation> GetByParent(IUmbracoEntity parent, string relationTypeAlias)
{
return GetByParent(parent).Where(relation => relation.RelationType.Alias == relationTypeAlias);
}
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child Id
/// </summary>
@@ -142,6 +163,27 @@ namespace Umbraco.Core.Services
}
}
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child Entity
/// </summary>
/// <param name="child">Child Entity to retrieve relations for</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
public IEnumerable<IRelation> GetByChild(IUmbracoEntity child)
{
return GetByChildId(child.Id);
}
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child Entity
/// </summary>
/// <param name="child">Child Entity to retrieve relations for</param>
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
public IEnumerable<IRelation> GetByChild(IUmbracoEntity child, string relationTypeAlias)
{
return GetByChild(child).Where(relation => relation.RelationType.Alias == relationTypeAlias);
}
/// <summary>
/// Gets a list of <see cref="Relation"/> objects by their child or parent Id.
/// Using this method will get you all relations regards of it being a child or parent relation.
@@ -422,7 +464,7 @@ namespace Umbraco.Core.Services
public bool AreRelated(int parentId, int childId, string relationTypeAlias)
{
var relType = GetRelationTypeByAlias(relationTypeAlias);
if(relType == null)
if (relType == null)
return false;
return AreRelated(parentId, childId, relType);
@@ -445,6 +487,29 @@ namespace Umbraco.Core.Services
}
}
/// <summary>
/// Checks whether two items are related
/// </summary>
/// <param name="parent">Parent entity</param>
/// <param name="child">Child entity</param>
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
public bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child)
{
return AreRelated(parent.Id, child.Id);
}
/// <summary>
/// Checks whether two items are related
/// </summary>
/// <param name="parent">Parent entity</param>
/// <param name="child">Child entity</param>
/// <param name="relationTypeAlias">Alias of the type of relation to create</param>
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
public bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias)
{
return AreRelated(parent.Id, child.Id, relationTypeAlias);
}
/// <summary>
/// Saves a <see cref="Relation"/>