Ejemplo n.º 1
0
 /**
  * @param int $profileId The id of the application profile. defaults to '1'
  *
  * @return ProfileProperty[]
  */
 public static function getPropertyArray($profileId = 1)
 {
     //init the array
     /** @var ProfileProperty[] $propArray */
     $propArray = [];
     //get the profile properties
     $c = new Criteria();
     $c->add(ProfilePropertyPeer::PROFILE_ID, $profileId);
     /** @var ProfileProperty[] $ProfileProps */
     $ProfileProps = ProfilePropertyPeer::doSelect($c);
     foreach ($ProfileProps as $prop) {
         $propArray[$prop->getId()] = $prop;
     }
     //todo: figure out a better way to set the rdf:type property. probably in the data
     /** This is the id of rdf:type, which isn't used directly  */
     $propArray[4]->setName("@type");
     $propArray[4]->setLabel("@type");
     return $propArray;
 }
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      Connection $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(ProfilePropertyPeer::ID, $pks, Criteria::IN);
         $objs = ProfilePropertyPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this ProfileProperty has previously
  * been saved, it will retrieve related ProfilePropertysRelatedByInverseProfilePropertyId from storage.
  * If this ProfileProperty is new, it will return
  * an empty collection or the current collection, the criteria
  * is ignored on a new object.
  *
  * @param      Connection $con
  * @param      Criteria $criteria
  * @throws     PropelException
  */
 public function getProfilePropertysRelatedByInverseProfilePropertyId($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BaseProfilePropertyPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collProfilePropertysRelatedByInverseProfilePropertyId === null) {
         if ($this->isNew()) {
             $this->collProfilePropertysRelatedByInverseProfilePropertyId = array();
         } else {
             $criteria->add(ProfilePropertyPeer::INVERSE_PROFILE_PROPERTY_ID, $this->getId());
             ProfilePropertyPeer::addSelectColumns($criteria);
             $this->collProfilePropertysRelatedByInverseProfilePropertyId = ProfilePropertyPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(ProfilePropertyPeer::INVERSE_PROFILE_PROPERTY_ID, $this->getId());
             ProfilePropertyPeer::addSelectColumns($criteria);
             if (!isset($this->lastProfilePropertyRelatedByInverseProfilePropertyIdCriteria) || !$this->lastProfilePropertyRelatedByInverseProfilePropertyIdCriteria->equals($criteria)) {
                 $this->collProfilePropertysRelatedByInverseProfilePropertyId = ProfilePropertyPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastProfilePropertyRelatedByInverseProfilePropertyIdCriteria = $criteria;
     return $this->collProfilePropertysRelatedByInverseProfilePropertyId;
 }
 /**
  * Retrieve a single object by pkey.
  *
  * @param $skosId int
  * @param      Connection $con the connection to use
  * @return ProfileProperty
  * @throws PropelException
  */
 public static function retrieveBySkosID($skosId, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria(ProfilePropertyPeer::DATABASE_NAME);
     $criteria->add(ProfilePropertyPeer::SKOS_ID, $skosId);
     $v = ProfilePropertyPeer::doSelect($criteria, $con);
     return !empty($v) > 0 ? $v[0] : null;
 }
 /**
  * Get the associated ProfileProperty object
  *
  * @param      Connection $con Optional Connection object.
  * @return     ProfileProperty The associated ProfileProperty object.
  * @throws     PropelException
  */
 public function getSkosProperty($con = null)
 {
     if ($this->aProfileProperty === null && $this->skos_property_id !== null) {
         // include the related Peer class
         include_once 'lib/model/om/BaseProfilePropertyPeer.php';
         $c = new \Criteria();
         $c->add(\ProfilePropertyPeer::SKOS_ID, $this->skos_property_id);
         $this->aProfileProperty = ProfilePropertyPeer::doSelect($c, $con);
     }
     return $this->aProfileProperty;
 }