示例#1
0
	/**
	 * date de verrouillage de la periode. On rajoute le temps 23:59:59
	 *
	 * @param      string $format The date/time format string (either date()-style or strftime()-style).
	 *							If format is NULL, then the raw DateTime object will be returned.
	 * @return     mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
	 * @throws     PropelException - if unable to parse/validate the date/time value.
	 */
	public function getDateFin($format = 'Y-m-d H:i:s') {
	    //on fini la periode a 23:59
	    $date_fin = parent::getDateFin(null);
	    if ($date_fin == null) {
		return null;
	    } else {
		$date_fin->setTime(23,59,59);
		if ($format === null) {
			// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
			return $date_fin;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $date_fin->format('U'));
		} else {
			return $date_fin->format($format);
		}
	    }
	}
示例#2
0
	/**
	 * Returns a peer instance associated with this om.
	 *
	 * Since Peer classes are not to have any instance attributes, this method returns the
	 * same instance for all member of this class. The method could therefore
	 * be static, but this would prevent one from overriding the behavior.
	 *
	 * @return     PeriodeNotePeer
	 */
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new PeriodeNotePeer();
		}
		return self::$peer;
	}